graphene-os-server-infrastr.../etc/syslog-ng/conf.d/nginx.conf
Daniel Micay b80f10f396 syslog-ng: add receive timestamps to nginx logs
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 doesn't
work perfectly since $msec generates the time on-demand separately from
the timestamp used by $time_iso8601.
2025-11-21 11:31:48 -05:00

22 lines
540 B
Nginx Configuration File

source s_nginx_access {
unix-dgram("/run/nginx-access-log" group("http") perm(0660));
};
source s_nginx_error {
unix-dgram("/run/nginx-error-log" group("http") perm(0660));
};
destination d_nginx_access {
file("/var/log/nginx/access.log" template("${R_ISODATE} ${MESSAGE}\n"));
};
destination d_nginx_error {
file("/var/log/nginx/error.log" template("${R_ISODATE} ${MESSAGE}\n"));
};
log {
source(s_nginx_access);
destination(d_nginx_access);
};
log {
source(s_nginx_error);
destination(d_nginx_error);
};