fix(dynamic_log_level): not work for nginx debug log#69
Open
fix(dynamic_log_level): not work for nginx debug log#69
Conversation
chobits
commented
Sep 27, 2023
|
|
||
| /* adhere to nginx conventions */ | ||
| if (log_level == NGX_LOG_DEBUG) { | ||
| log_level = NGX_LOG_DEBUG_ALL; |
Contributor
Author
There was a problem hiding this comment.
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;
}
chobits
commented
Sep 27, 2023
|
|
||
| if (log_level == NGX_LOG_DEBUG_ALL) { | ||
| log_level = NGX_LOG_DEBUG; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
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.
ADD-SP
suggested changes
Sep 28, 2023
Contributor
Author
|
Do not merge this PR until we have released 3.5. We should make sure that kong 3.5 is stable and reliable. |
chronolaw
approved these changes
Oct 13, 2023
8e873a0 to
2b68038
Compare
ADD-SP
approved these changes
Dec 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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