feat(ops/nixos/camden): Modify nginx log format

This log format contains more structured and correctly typed
information, which I can now use for dashboards and stuff in Stackdriver.
This commit is contained in:
Vincent Ambo 2020-02-21 16:10:08 +00:00
parent 1e51a2135d
commit 25d8e7ce25

View file

@ -191,15 +191,15 @@ in lib.fix(self: {
commonHttpConfig = ''
log_format json_combined escape=json
'{'
'"time_local":"$time_local",'
'"remote_addr":"$remote_addr",'
'"remote_user":"$remote_user",'
'"request":"$request",'
'"status": "$status",'
'"body_bytes_sent":"$body_bytes_sent",'
'"request_time":"$request_time",'
'"http_referrer":"$http_referer",'
'"http_user_agent":"$http_user_agent"'
'"method":"$request_method",'
'"uri":"$request_uri",'
'"status":$status,'
'"request_size":$request_length,
'"response_size":$body_bytes_sent,'
'"response_time":$request_time,'
'"referrer":"$http_referer",'
'"user_agent":"$http_user_agent"'
'}';
access_log syslog:server=unix:/dev/log,nohostname json_combined;