[PATCH] Script: fix log level when matching regular expressions

Maxim Dounin mdounin at mdounin.ru
Fri May 27 18:33:59 UTC 2016


Hello!

On Fri, May 27, 2016 at 02:11:06PM -0300, Giovani Rinaldi wrote:

> # HG changeset patch
> # User Giovani Rinaldi <giovani.rinaldi at azion.com>
> # Date 1464122415 0
> # Node ID a6209fc7fc0941be30850050025cfe830805b1a8
> # Parent  bc6fd7afeed6f7433c60634d9b0867ea3241b217
> Script: fix log level when matching regular expressions
> 
> Log should be written to log directive that accepts debug level.
> 
> diff -r bc6fd7afeed6 -r a6209fc7fc09 src/http/ngx_http_script.c
> --- a/src/http/ngx_http_script.c    Tue May 24 21:54:32 2016 +0300
> +++ b/src/http/ngx_http_script.c    Tue May 24 20:40:15 2016 +0000
> @@ -933,7 +933,7 @@
> 
>      if (rc == NGX_DECLINED) {
>          if (e->log || (r->connection->log->log_level &
> NGX_LOG_DEBUG_HTTP)) {
> -            ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
> +            ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
>                            "\"%V\" does not match \"%V\"",
>                            &code->name, &e->line);
>          }
> @@ -967,7 +967,7 @@
>      }
> 
>      if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
> -        ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
> +        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
>                        "\"%V\" matches \"%V\"", &code->name, &e->line);
>      }

The patch is wrong, it will break the rewrite_log directive, see 
http://nginx.org/r/rewrite_log.

(And no, further attempts to fix this are not needed, thanks.)

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list