-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add support for deleting old logs #36
Comments
I have the same problem, can't use linux |
See also #19 for a possible solution that enables logrotate support (I still need to update it to the latest master though) |
Hi ezegomez, I'm not sure the suggested change would solve my problem.
would it keep writing past 10MB or delete myapp.log and recreates the same file? Either way, it won't work for us, as we want to limit the amount of logs and at the same time don't want to lose all logs when log rotates. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
+1 for this feature, otherwise I need to write scripts to rotate these files. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Any updates on this feature ? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Locking the issue due to spam. |
Hi,
Can we add a support for deleting old logs?
As of now, log just keeps accumulating until it takes entire disk space.
If we set the max log size to 10MB, glog keeps generating 10MB log files never deleting.
I'd like to keep only latest 4 logs (of 10MB or smaller).
I know there are tools which can be run to do the cleanup such as logrotate.
We make Windows DLL which runs on embedded machine made by another company. We don't have control on this embedded machine, so we cannot run any program to rotate the log.
I've added RotateLogFile function which checks for number of log files and deletes old logs.
RotateLogFile is run in LogFileObject::Write as it log is rolled over and new log file is created (when max_log_size is reached).
so if we have following 4 logs,
log_20150617-141944.8600
log_20150618-166949.8600
log_20150619-119953.8600
log_20150620-107957.8600
And if a new one is created, the oldest one is deleted leaving 4 logs
log_20150617-141944.8600 <-Deleted
log_20150618-163949.8600
log_20150619-112953.8600
log_20150620-101957.8600
log_20150621-103957.8600 <-- Created
Has this feature been considered before? Can you add this?
Thanks,
Isao
The text was updated successfully, but these errors were encountered: