Skip to content
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

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 #694

Open
huozhirui opened this issue Nov 24, 2022 · 3 comments
Labels
question This issue looks like a usage problem, not a bug or feature request

Comments

@huozhirui
Copy link

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

@jaqx0r
Copy link
Contributor

jaqx0r commented Dec 8, 2022

Can you use a symlink to the latest log file, that gets updated after the logs are rotated?

@huozhirui
Copy link
Author

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.

@jaqx0r
Copy link
Contributor

jaqx0r commented Jan 1, 2023

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

@jaqx0r jaqx0r added the question This issue looks like a usage problem, not a bug or feature request label Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue looks like a usage problem, not a bug or feature request
Projects
None yet
Development

No branches or pull requests

2 participants