Skip to content

Commit 89ddf10

Browse files
committed
nginx: switch to timestamps generated by syslog-ng
Since nginx only uses 1 second precision for the error logs and syslog timestamps, we can use receive time on the syslog-ng side. We can switch to source time once nginx adds RFC 5424 support which is currently in an open pull request but will likely require changes to add a configuration option for it. Our approach to working around this within nginx didn't work perfectly since $msec obtains the time on-demand separately from $time_iso8601.
1 parent 0392973 commit 89ddf10

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

nginx/nginx.conf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ http {
7979
ssl_session_timeout 1d;
8080
ssl_buffer_size 4k;
8181

82-
map $time_iso8601&$msec $time_log {
83-
~(.+)\+.+&\d+\.(\d+) "$1.$2Z";
84-
}
85-
86-
log_format main '$time_log $connection-$connection_requests $remote_addr $remote_user $ssl_session_reused $ssl_protocol $server_protocol '
82+
log_format main '$connection-$connection_requests $remote_addr $remote_user $ssl_session_reused $ssl_protocol $server_protocol '
8783
'$host $request_method "$request_uri" $status $request_length $body_bytes_sent/$bytes_sent '
8884
'$request_time $upstream_connect_time/$upstream_header_time/$upstream_response_time '
8985
'$upstream_cache_status "$http_referer" "$http_user_agent"';

0 commit comments

Comments
 (0)