-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(file-logger): add path properties to file-logger plugin metadata #12825
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(file-logger): add path properties to file-logger plugin metadata #12825
Conversation
apisix/plugins/file-logger.lua
Outdated
| return metadata.value.path | ||
| end | ||
|
|
||
| return nil, "property \"path\" is required" |
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.
We have removed required = {"path"}, but it returns is required when path is empty. can we add something like neither the metadata nor the conf is configured
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.
Hi @TaeyeongKwak, I submitted a suggested change and committed suggestion for this comment, but it seems the error message in the test also needs to be fixed. Could you please help me with that? It's located in t/plugin/file-logger.t. (TEST 1)
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.
@Baoyuantop, I’ve fixed the error message in the test you mentioned.
ronething
left a comment
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.
others lgtm.
2ccf531
Description
This PR adds
pathsupport to the file-logger plugin metadata, allowing a default log file path to be configured globally via plugin_metadata and used when an individual plugin config does not specify path.For example, a user can set a path through plugin metadata, as below:
As above, if the path properties exists in the plugin metadata, you can exclude the path properties of the file-logger plugin when setting the route.
Checklist