-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(log): add nested log format support for logger plugins #12697
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
base: master
Are you sure you want to change the base?
feat(log): add nested log format support for logger plugins #12697
Conversation
|
Hi @TaeyeongKwak, do we need to limit the maximum nesting level? In addition, you need to add the corresponding documentation content. |
Hi @Baoyuantop, Thank you for your comment. And currently, I've only added test cases to some plugins. Should I add test cases for the other plugins too? |
|
Hi @TaeyeongKwak, I think creating a test for just one plugin is sufficient. |
@Baoyuantop I notice some CI checks are currently failing, but they don’t seem related to the changes in this PR. Is there anything I might be missing? |
|
Hi @TaeyeongKwak, I saw some errors related to sls-logger. Could you run a test locally to check? You can refer to http://apisix.apache.org/docs/apisix/build-apisix-dev-environment-devcontainers/ |
Hi @Baoyuantop, root@a1bd1377d5dd:/workspace# git branch --show-current
feat-support-nested-log-format
root@a1bd1377d5dd:/workspace# FLUSH_ETCD=1 prove -Itest-nginx/lib -I. -r t/plugin/sls-logger.t
t/plugin/sls-logger.t .. ok
All tests successful.
Files=1, Tests=49, 32 wallclock secs ( 0.02 usr 0.00 sys + 1.00 cusr 0.91 csys = 1.93 CPU)
Result: PASSIs there anything I might have missed while performing the test? |
Description
This PR adds support for nested log format in logger plugins. Previously, the
log_formatconfiguration only supported flat key-value structures. This feature allows users to more efficiently organize and group log fields by defining hierarchical/overlapping log structures.For example, user can set log_format as below:
Output Example:
Which issue(s) this PR fixes:
Fixes #
Checklist