apisix
apisix copied to clipboard
feat: file-log-plugin should combine with log-rotate
Description
I found that file-log-plugin just write one file. I think we can combine with log-rotate(or another method) plugin to split file.
They are not really related, can you give more details?
They are not really related, can you give more details?
I mean ,the file-log-plugin write only one file. I think the file will be very large. we should split them
good idea, we should make the file logger itself support log file rotation.. cc @spacewander
This is not easy to combine these two plugins. But we can make a try.
This is not easy to combine these two plugins. But we can make a try.
Maybe we can make file-logger support log file rotation (without modifying the log-rotate plugin, or extracting some common functions)?
This is not easy to combine these two plugins. But we can make a try.
Maybe we can make file-logger support log file rotation (without modifying the log-rotate plugin, or extracting some common functions)?
yes, I think it can be.
i meet same problem;
What if we support configuring the file names for both the log-rotate plugin and file-logger plugin?
What if we support configuring the file names for both the log-rotate plugin and file-logger plugin?
yes we need logrotate
I think of this a bit. What about configuring the log rotate configuration in file-logger's metadata? And let the plugin level conf refers the conf in the metadata. Therefore we can:
- make the file log rotate conf can be changed dynamically
- don't need to configure the log rotate repeatedly in each plugin level conf
CC @monkeyDluffy6017
I just thought about your proposal, so we could get metadata from timer and roate file log in timer ? @spacewander
What if we support configuring the file names for both the log-rotate plugin and file-logger plugin?
yes we need logrotate
I mean, we should avoid doing duplicated things, if we can combine the two plugins and let them to work for the needs, why do we need to modify the file-logger plugin to support a supported feature?
@tokers maybe it's not good idea to link the 2 plugins, it's better to make them independent ?
@tokers maybe it's not good idea to link the 2 plugins, it's better to make them independent ?
The combine means using them together. Of course, they should be independent.
Putting the configuration into log-rotate is possible, but there are some cons so I personally don't like this idea.
Here is the limitation:
- the feature is meaningful only when used with other plugins like file-logger.
- it requires rewriting the current implementation. The current implementation uses a static conf file to configure the log rotate options and hardcodes the log file's name. The workload of modification isn't lower than modifying the file-logger.