[edit] log_format

Syntax: log_format name string ...
Default: combined "..."
Context: http
Reference: log_format


The log_format directive describes the format of a log entry. You can use general variables in the format, as well as variables which exist only at the moment of writing into the log:

The headers, transmitted to client, begin from the prefix "sent_http_", for example, $sent_http_content_range.

Note that variables produced by other modules can also be logged. For example you can log upstream response headers with the prefix "upstream_http_", see upstream .

There is a predefined log format called "combined":

log_format combined '$remote_addr - $remote_user [$time_local]  '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent"';

Module: HttpLogModule