Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Log rotation #421

Closed
3 tasks
tzdybal opened this issue Nov 28, 2017 · 2 comments · Fixed by #426
Closed
3 tasks

Log rotation #421

tzdybal opened this issue Nov 28, 2017 · 2 comments · Fixed by #426

Comments

@tzdybal
Copy link
Contributor

tzdybal commented Nov 28, 2017

Currently, if logs are stored in files, there is no way to control the resulting files - with verbose logging, disk space required by logs can grow very fast.
Unfortunately with glog it's not possible to use standard logrotate command.
See: google/glog#19 and google/glog#36.

In my opinion, we need two features:

  • removal of old log files (older than configurable duration)
  • enforcing total logs size limit (also configurable)

Bonus feature:

  • compress all archive (not current) log files
@tzdybal tzdybal added this to the 4.2 - Improved usability milestone Nov 28, 2017
@tzdybal tzdybal self-assigned this Nov 28, 2017
@splix
Copy link
Contributor

splix commented Nov 29, 2017

Maybe we can use timestamped log filenames instead? compression/removal could be done by system

@tzdybal
Copy link
Contributor Author

tzdybal commented Nov 29, 2017

Actually, currently we use timestamped filenames and this is the cause of the problem, because standard tools (logrotate, newsyslog) expect the filename to be static (without the timestamp part).

glog filename pattern is following: <program>.<host>.<user>.log.<tag>.<timestamp>.<pid>. New log file is created after reaching file size limit (so glog does part of the job of logrotate/newsyslog), and there is a symlink always pointing to the latest log file.

I don't know any standard tool able to compress/remove files in such scheme. And I think that possibility to configure the log rotation without any external tools would be very convenient.

@whilei whilei modified the milestones: 4.2 - Improved usability, 4.3 - Improve logging Nov 30, 2017
@tzdybal tzdybal modified the milestones: 4.3 - Improve logging, 4.2 - Improved usability Dec 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants