Closed gz-c closed 6 years ago
This is a proposal for handling logs
Using https://github.com/NYTimes/logrotate
Add a new method similar to logger.NewFileWriteHook (src/util/logger.go) which wraps the *os.File pointer with the logrotate-aware wrapper.
logger.NewFileWriteHook
src/util/logger.go
*os.File
Use this constructor instead of NewFileWriteHook during logger initialization.
NewFileWriteHook
Add a documentation section to the README regarding logrotate support:
logrotate can be configured to send a SIGHUP to the application to trigger a rotation, which teller supports
Add instructions for how to configure logrotate this way.
The SIGHUP mechanism requires a pid file. Possibly use this to add one: https://github.com/facebookgo/pidfile
This is a proposal for handling logs
Using https://github.com/NYTimes/logrotate
Add a new method similar to
logger.NewFileWriteHook
(src/util/logger.go
) which wraps the*os.File
pointer with the logrotate-aware wrapper.Use this constructor instead of
NewFileWriteHook
during logger initialization.Add a documentation section to the README regarding logrotate support:
Add instructions for how to configure logrotate this way.
The SIGHUP mechanism requires a pid file. Possibly use this to add one: https://github.com/facebookgo/pidfile