-
How to deal with the log name with a suffix, such as access.log.20221221314, using access.log.* will load all the logs, I only want to monitor the logs of the current hour |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Can you use a symlink to the latest log file, that gets updated after the logs are rotated? |
Beta Was this translation helpful? Give feedback.
-
In this way, I need to establish a new soft connection every hour, and for multiple log files, I need to establish multiple maintenance logics, which is a lot of work. |
Beta Was this translation helpful? Give feedback.
-
Well the normal practice is to use log rotation to create the date-named log files so that there's a common base name to follow. After a timeout of one hour, all the logs that haven't been written to get removed from the list of watched logs: https://google.github.io/mtail/Deploying.html#setting-garbage-collection-intervals |
Beta Was this translation helpful? Give feedback.
Well the normal practice is to use log rotation to create the date-named log files so that there's a common base name to follow.
After a timeout of one hour, all the logs that haven't been written to get removed from the list of watched logs: https://google.github.io/mtail/Deploying.html#setting-garbage-collection-intervals