Stream log directives
log_format (stream)
stream context; sets session log format.
Formal Syntax & Structure
nginx syntaxnginx
log_format name [escape=default|json|none] string ...;Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | identifier | Name a session log format. |
| escape | escape=default | escape=json | escape=none | Select variable escaping; JSON escaping does not itself construct valid JSON. |
| format | one or more strings | Log template containing literal text and variables; avoid sensitive data. |
Working Example
Example Snippetnginx
log_format session "$protocol $status $session_time";