]> git.kaiwu.me - njs.git/commitdiff
Improved logging for js_set and js_content directives.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 28 May 2018 14:05:17 +0000 (17:05 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 28 May 2018 14:05:17 +0000 (17:05 +0300)
Previously, unknown functions were reported under the debug log level
which made the debugging of misconfigured directives harder.

nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c

index 111ce852374d42d4da68400a5301f2bb40e7e3bf..645f811cb5c64369c00ae492753a265073499f2f 100644 (file)
@@ -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;
     }
index 4f96e33a54e4cf29149304b7c01107944361c2f8..87e313e09f10b60acfa31788f57b9d8be78b41dc 100644 (file)
@@ -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;
     }