Send nginx logs to journald (#583)
nginx only logs to files, so its access and error logs never reach journald or VictoriaLogs, and proxy errors (e.g. consul.service.consul 502s) can't be diagnosed from vlogs. - add a `journald` log_format with `$host`, request time and upstream addr/status/response time - add syslog (`unix:/dev/log`) targets estate-wide: `tag=nginx_access` for access, `tag=nginx` for errors - add the same syslog targets to the per-vhost logs in simpleproxy, edgecache, reposync, certbot and puppetboard, keeping the existing files Reviewed-on: #583 Co-authored-by: unkin-agent <unkin-agent@unkin.net> Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #583.
This commit is contained in:
@@ -69,8 +69,14 @@ class certbot::nginx (
|
||||
'listen_port' => $listen_port,
|
||||
'server_name' => $server_names,
|
||||
'use_default_location' => true,
|
||||
'access_log' => "/var/log/nginx/${nginx_vhost}_access.log",
|
||||
'error_log' => "/var/log/nginx/${nginx_vhost}_error.log",
|
||||
'access_log' => [
|
||||
"/var/log/nginx/${nginx_vhost}_access.log",
|
||||
'syslog:server=unix:/dev/log,tag=nginx_access journald',
|
||||
],
|
||||
'error_log' => [
|
||||
"/var/log/nginx/${nginx_vhost}_error.log",
|
||||
'syslog:server=unix:/dev/log,tag=nginx',
|
||||
],
|
||||
'www_root' => "${data_root}/pub",
|
||||
'autoindex' => 'on',
|
||||
'ssl' => $enable_ssl,
|
||||
|
||||
Reference in New Issue
Block a user