-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(conf): support Nginx fine-grained debug levels #12842
Conversation
Expose seven additional Nginx log levels that are not normally exposed by OpenResty, which allows for finer-grained debugging with less noise in the debug-level logs: `debug_core`, `debug_alloc`, `debug_mutex`, `debug_event`, `debug_http`, `debug_mail`, `debug_stream`.
Dynamically enabling the extended debug log levels requires a new version of lua-kong-nginx-module which incorporates Kong/lua-kong-nginx-module#87
0926b64
to
e8defcb
Compare
If Kong/lua-kong-nginx-module#87 gets merged and the lua-kong-nginx-module is bumped, then the second commit from this branch (e8defcb) can be removed, and extended debug modes will work both statically and dynamically. As this PR stands right now, these extra |
@hishamhm, freaky, what is |
@hishamhm I suggest you add:
in But in case you want that still, then perhaps the new debug levels make sense? |
It is also strange that |
@bungle Yes, so it never shows up and it quiets down the other C-level nginx debug logs, leaving only the debug logs we care about (OpenResty+Kong and WasmX).
I'll try that out, thanks!! @locao, was that the local trick you were referring to?
Kong packages/containers are already built like that right? So if I have a way to do that locally (and I can never see those gazillion (True story: I forgot a Kong instance running idle on my local machine after a day of debugging and woke up the next day to find everything failing on my machine due to zero disk space... twice!) |
Kong distributions (those that we ship) are build without |
Yes, it will silence the C-level logs. (After two months I am sure you already tested it, but maybe someone else can benefit from it 😁) |
@locao Indeed, thanks! Given those tips serve as a usable alternative, I think we can retire this PR! |
Hmm too bad, this is precisely why those debug levels are painful to us. When working on an Nginx module embedded in the Gateway (be it kong-lua-module or ngx-wasm-module), we still want our module's debug logs be enabled, while still silencing the other Nginx debug logs that Hisham mentioned. |
Summary
Expose seven additional Nginx log levels that are not normally exposed by OpenResty, which allows for finer-grained debugging with less noise in the debug-level logs:
debug_core
,debug_alloc
,debug_mutex
,debug_event
,debug_http
,debug_mail
,debug_stream
.By setting a quieter value such as
debug_mail
, Kong Gateway debug logs are usable again, as the Kong (and WasmX) logs are still shown, but the other Nginx debug logs (memory allocations, etc.) are not shown.Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdThere is a user-facing docs PR against https://github.com/Kong/docs.konghq.com- updated docs are auto-generated fromkong.conf.default
Support for dynamically setting these additional levels depends on this companion PR for lua-kong-nginx-module: Kong/lua-kong-nginx-module#87