Option to add json formatting to access logs
10K+
Nginx docker image with json log format.
Set variable $application to your application name, and create a server directive specifying "json" as access_log type, as in the below example.
default.conf example
server {
listen 80;
set $application 'nginx-jsonlog';
access_log /var/log/nginx/access.log json;
error_log /var/log/nginx/error.log error;
location / {
return 200 'hello world';
add_header Content-Type text/plain;
}
location /healthcheck {
return 200 'healthy';
add_header Content-Type text/plain;
}
}
Content type
Image
Digest
Size
7.5 MB
Last updated
over 8 years ago
docker pull ricc/nginx-jsonlog