-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dynamic_log_level): not work for nginx debug log #69
base: master
Are you sure you want to change the base?
Conversation
@@ -63,6 +63,11 @@ ngx_http_lua_kong_ffi_set_dynamic_log_level(int log_level, int timeout) | |||
return NGX_ERROR; | |||
} | |||
|
|||
/* adhere to nginx conventions */ | |||
if (log_level == NGX_LOG_DEBUG) { | |||
log_level = NGX_LOG_DEBUG_ALL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers, we need to adhere nginx conventions here. like the nginx magic, note taht NGX_LOG_DEBUG_ALL is numerically greater than NGX_LOG_DEBUG. This numeric relationship is crucial for the functioning of all code segments that involve log->log_level
comparison in Nginx.
// src/core/ngx_log.c
ngx_http_core_error_log
-> ngx_log_set_log
-> ngx_log_set_levels
static char *
ngx_log_set_levels(ngx_conf_t *cf, ngx_log_t *log)
{
+-- 52 lines: ngx_uint_t i, n, d, found;----------------------------------------------------------------------------
if (log->log_level == NGX_LOG_DEBUG) {
log->log_level = NGX_LOG_DEBUG_ALL;
}
return NGX_CONF_OK;
}
|
||
if (log_level == NGX_LOG_DEBUG_ALL) { | ||
log_level = NGX_LOG_DEBUG; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the caller using ffi call, we need to translate it from 0x7fff fff0
to log level number 0~8
.
This comment was marked as off-topic.
This comment was marked as off-topic.
Do not merge this PR until we have released 3.5. We should make sure that kong 3.5 is stable and reliable. |
8e873a0
to
2b68038
Compare
DESCRIPTION
When we use this api to modify log level to debug, nginx debug log does not output. The lua debug log works as expected.
CHANGELOG
ISSUE
fix KAG-2644