In this recipe, we're going to customize the logs to give us a bit more information when it comes to applications and metrics. Additional information, such as the response time, can be immensely useful for measuring the responsiveness of your application. While it can generally be generated within your application stack, it can also induce some overhead or give incomplete results.
Application focused logging
How to do it...
To start with, we need to define our new log format:
log_format applogs '$remote_addr $remote_user $time_iso8601' '"$request" $status $body_bytes_sent ' '$request_time $upstream_response_time';
The log_format directive...