mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2025-11-24 08:43:11 -05:00
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.
22 lines
540 B
Nginx Configuration File
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);
|
|
};
|