Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

tolog

Presentation

tolog is a simple tool to make software that logs to standard output play nice with logrotate.

Usage

Pipe the output of your software to tolog, keep a PID file. In practice you will probably do this in an init script.

myprogram | tolog /var/log/myprogram.log & echo $! > /var/run/myprogram.tolog.pid

Tell logrotate to send USR1 to tolog to reopen the logfile after rotating.

/var/log/myprogram.log {
    missingok
    compress
    postrotate
        test -r /var/run/myprogram.tolog.pid && kill -USR1 `cat /var/run/myprogram.tolog.pid`
    endscript
}

Copyright

Copyright (c) 2015 Pierre Chapuis

About

make software that logs to standard output play nice with logrotate

Topics

Resources

License

Releases

No releases published

Packages

No packages published