Answer the question
In order to leave comments, you need to log in
How to change log format in nginx?
I change the log format as follows
server{
...
log_format piwik '{"ip": "$remote_addr",'
'"host": "$host",'
'"path": "$request_uri",'
'"status": "$status",'
'"referrer": "$http_referer",'
'"user_agent": "$http_user_agent",'
'"length": $bytes_sent,'
'"generation_time_milli": $request_time,'
'"date": "$time_iso8601"}';
access_log /path/to/log/log_access.log piwik;
error_log /path/to/log/log_error.log piwik;
...
}
Answer the question
In order to leave comments, you need to log in
The error_log cannot be formatted.
log_format should be inside http, not server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question