Closed MacLeodMike closed 9 years ago
Why restart the service on log rotate?
On Jul 19, 2015, at 09:48, MacLeodMike notifications@github.com wrote:
Resolves #84
You can view, comment on, or merge this pull request online at:
https://github.com/appcanary/agent/pull/87
Commit Summary
Logrotate scripts Added test File Changes
A package/amazon/2015.03/files/etc/logrotate.d/appcanary (11) A package/centos/6/files/etc/logrotate.d/appcanary (11) A package/centos/7/files/etc/logrotate.d/appcanary (11) A package/debian/jessie/files/etc/logrotate.d/appcanary (11) A package/debian/wheezy/files/etc/logrotate.d/appcanary (11) A package/redhat/6/files/etc/logrotate.d/appcanary (11) A package/redhat/7/files/etc/logrotate.d/appcanary (11) A package/ubuntu/precise/files/etc/logrotate.d/appcanary (11) A package/ubuntu/trusty/files/etc/logrotate.d/appcanary (11) A package/ubuntu/vivid/files/etc/logrotate.d/appcanary (11) M test/pkg/Rakefile (1) Patch Links:
https://github.com/appcanary/agent/pull/87.patch https://github.com/appcanary/agent/pull/87.diff — Reply to this email directly or view it on GitHub.
If you don't maintain the file socket then we don't have to. But not knowing whether you do or not, this was the safer approach. If you keep the socket open when the file is rotated you'll continue to write to the old file.
We should also know how often you want to rotate. I set it for weekly, but I don't know how much the agent actually logs in general use.
How many logs does this keep? Or is it just rotating them without deleting the old ones?
On Jul 19, 2015, at 09:58, MacLeodMike notifications@github.com wrote:
If you don't maintain the file socket then we don't have to. But not knowing whether you do or not, this was the safer approach. If you keep the socket open when the file is rotated you'll continue to write to the old file.
We should also know how often you want to rotate. I set it for weekly, but I don't know how much the agent actually logs in general use.
— Reply to this email directly or view it on GitHub.
Rotate once a week, and keep four weeks of data. It compresses rotated files.
Would you prefer to rotate daily and keep seven? That's the other common setting.
Do you open a new filehandle each time you write to log? If so I can remove the restart. Alternatively, it's also common practice for long running processes to react to HUP by rereading config files and closing/recreating file handles. If you do that then I can do that instead.
Pretty sure we don't so a restart for now will do.
Be cool to trigger writing to the log and testing that also.
On Jul 19, 2015, at 10:16, MacLeodMike notifications@github.com wrote:
Rotate once a week, and keep four weeks of data. It compresses rotated files.
Would you prefer to rotate daily and keep seven? That's the other common setting.
Do you open a new filehandle each time you write to log? If so I can remove the restart. Alternatively, it's also common practice for long running processes to react to HUP by rereading config files and closing/recreating file handles. If you do that then I can do that instead.
— Reply to this email directly or view it on GitHub.
Resolves #84