The '''access_log''' directive sets the path, format and buffer size for the access log file. Using "off" as the only parameter clears all '''access_log''' directives for the current level. If the format is not indicated, it defaults to [[NginxHttpLogModule#log_format_combined|"combined"]]. The size of buffer must not exceed the size of the atomic record for writing into the disk file. This size is not limited for FreeBSD 3.0-6.0.

The '''access_log''' directive sets the path, format and buffer size for the access log file. Using "off" as the only parameter clears all '''access_log''' directives for the current level. If the format is not indicated, it defaults to [[NginxHttpLogModule#log_format_combined|"combined"]]. The size of buffer must not exceed the size of the atomic record for writing into the disk file. This size is not limited for FreeBSD 3.0-6.0.

The access_log directive sets the path, format and buffer size for the access log file. Using "off" as the only parameter clears all access_log directives for the current level. If the format is not indicated, it defaults to "combined". The size of buffer must not exceed the size of the atomic record for writing into the disk file. This size is not limited for FreeBSD 3.0-6.0.

The log file path can contain variables (version >=0.7.4) but such logs have some limitations:

worker user must have permission to create files in;

buffering does not work;

for each log entry, the file is opened and immediately closed after writing the record. However, descriptors of frequently used files may be stored in open_log_file_cache . Regarding log rotation, it must be kept in mind that over time (which is set by the parameter valid of directive open_log_file_cache), logging can be still continue to the old file.

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:

$body_bytes_sent, the number of bytes, transmitted to client minus the response headers. This variable is compatible with the %B parameter of Apache's mod_log_config (this was called $apache_bytes_sent, before version 0.3.10)

$bytes_sent, the number of bytes transmitted to client

$connection, the number of connection

$msec, the current time at the moment of writing the log entry (microsecond accuracy)