From 373175bfb7a1f564580c654f8ea517320abf7c15 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Mon, 28 May 2018 17:05:17 +0300 Subject: [PATCH] Improved logging for js_set and js_content directives. Previously, unknown functions were reported under the debug log level which made the debugging of misconfigured directives harder. --- nginx/ngx_http_js_module.c | 8 ++++---- nginx/ngx_stream_js_module.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 111ce852..645f811c 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -665,8 +665,8 @@ ngx_http_js_content_event_handler(ngx_http_request_t *r) func = njs_vm_function(ctx->vm, &name); if (func == NULL) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "js function \"%V\" not found", &jlcf->content); + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "js function \"%V\" not found", &jlcf->content); ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; } @@ -773,8 +773,8 @@ ngx_http_js_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, func = njs_vm_function(ctx->vm, &name); if (func == NULL) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "js function \"%V\" not found", fname); + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "js function \"%V\" not found", fname); v->not_found = 1; return NGX_OK; } diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index 4f96e33a..87e313e0 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -585,8 +585,8 @@ ngx_stream_js_variable(ngx_stream_session_t *s, ngx_stream_variable_value_t *v, func = njs_vm_function(ctx->vm, &name); if (func == NULL) { - ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, - "js function \"%V\" not found", fname); + ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, + "js function \"%V\" not found", fname); v->not_found = 1; return NGX_OK; } -- 2.47.3