Configuring advanced logging

Under normal circumstances, we want logging to be as minimal as possible. Usually, what's important is which URIs were called by which clients and when, and if there was an error, to show the resulting error message. If we want to see more information, this leads into a debug logging configuration.

Debug logging

To activate debug logging, the nginx binary needs to have been compiled with the --with-debug configure flag. As this flag is not recommended for high performance production systems, we may want to provide two separate nginx binaries for our needs: the one that we use in production, and the one that has all the same compile-time flags (options given to the configure script), with the addition of --with-debug ...

Get Mastering NGINX - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.