Skip to content

Instantly share code, notes, and snippets.

@dirkjonker
dirkjonker / nginx.conf
Last active December 5, 2022 11:10
NGINX JSON log configuration for Google Cloud / StackDriver log format
# this outputs JSON formatted logs which are easy to parse for any logging agent (such as fluentd)
# the format conforms to Google Cloud Logging so logs are nicely structured in the logs viewer
# see also: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#httprequest
# put the following lines in your nginx config
# /etc/nginx/nginx.conf
log_format json_combined escape=json
'{'
'"time":"$msec",'