ModSecurity-nginx icon indicating copy to clipboard operation
ModSecurity-nginx copied to clipboard

Feature: Configurable Log Level

Open jeremyjpj0916 opened this issue 5 years ago • 6 comments

Would like this to be a environment variable we can set:

https://github.com/SpiderLabs/ModSecurity-nginx/blob/master/src/ngx_http_modsecurity_log.c#L33

ngx_log_error(NGX_LOG_INFO, (ngx_log_t *)log, 0, "%s", msg);

NGX_LOG_INFO is nice and appropriate likely for warning messages generally speaking. But info in many NGX deployments is too noisy regarding other things, so it would be nice if this was default to INFO but I could pick ERROR or DEBUG or NOTICE etc. Right now I drop in a patch file and run this line as:

ngx_log_error(NGX_LOG_ERROR, (ngx_log_t *)log, 0, "%s", msg);

Because that is the log level I want WAF detection information to run on for my use case.

jeremyjpj0916 avatar May 23 '20 06:05 jeremyjpj0916

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jun 23 '20 00:06 github-actions[bot]

Hi @jeremyjpj0916,

We have had discussions about those being INFO/ERROR/NOTICE in the past. We have had code changes about that as well. The biggest concern in the past was the correctness of the logging info inside Nginx, not the verbosity. In terms of it being too many massages, is not something that you can treat withing the rules?

zimmerle avatar Jul 03 '20 12:07 zimmerle

for me the reason i care about log level is very specifically openresty provides a lib to help pull various log messages by status, and in our code I need it to be of an error type for other code to pick up on it, so imo flexibility is always good, especially around various application log levels.

jeremyjpj0916 avatar Jul 30 '20 04:07 jeremyjpj0916

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Aug 30 '20 00:08 github-actions[bot]

Bad bot.

jeremyjpj0916 avatar Aug 30 '20 00:08 jeremyjpj0916