From: Dmitry Volyntsev Date: Mon, 28 May 2018 14:05:17 +0000 (+0300) Subject: Improved logging for js_set and js_content directives. X-Git-Tag: 0.2.1~5 X-Git-Url: http://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=373175bfb7a1f564580c654f8ea517320abf7c15;p=njs.git 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. --- 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; }