How can I tune nginx to write request time to logs such that awstats can show time taken for each request?
Also, how can I see requests by time taken in awstats?
This is the current format
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
Best Answer
As @Vladimir mentioned, to logs request time, edit your
log_format
directive as belows:and set the corresponding variables for
LogFormat
inawstats
configuration file:Here is an
extra1
section example:Building report: