Skip to content

Instantly share code, notes, and snippets.

@mjcreativeventures
Created February 15, 2016 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjcreativeventures/ff0a8aafc4846b2cb2b0 to your computer and use it in GitHub Desktop.
Save mjcreativeventures/ff0a8aafc4846b2cb2b0 to your computer and use it in GitHub Desktop.
nginx logging using json format
log_format le_json '"time": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"status": "$status", '
'"request": "$request", '
'"request_method": "$request_method", '
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent"';
access_log /var/log/nginx/access.log le_json;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment