One thing that could be done if you want to normally log at a higher level but sometimes drop to a lower level for debugging is to send the higher level log to a memory buffer, e.g.,
error_log /var/log/opscache/error.log warn;
error_log memory:32m debug;
the documentation is:
https://docs.nginx.com/nginx/admin-guide/monitoring/debugging/#writing-the-debugging-log-to-memory
On Friday, November 9, 2018 at 3:19:27 PM UTC-8, Thibault Charbonnier wrote:
Hi,
No, it is not possible to dynamically change the log level of 'error_log'.
However, you may care to have a look at the ngx.errlog[1] module, which,
assuming some tweaks in your monitoring infrastructure, can dynamically
change its filtering value of log levels, and let you achieve your end goal.
Best,
Thibault
[1]:
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/errlog.md