Default logs in JSON

Solved, i´ve created a new custom-nginx.template with this:

http {
log_format json_combined escape=json
‘{’
‘“time_local”:"$time_iso8601",’
‘“remote_addr”:"$remote_addr",’
‘“request”:"$request",’
‘“status”: “$status”,’
‘“request_time”:"$request_time",’
‘“connection_requests”:"$connection_requests",’
‘“http_user_agent”:"$http_user_agent"’
‘}’;

access_log ${{PROXY_ACCESS_LOG}} json_combined;

include ‘nginx-kong-template.conf’;
}

and on start do kong start -c kong.yml --nginx-conf custom-nginx.template

3 Likes