Re: [mongrel2] Log file rotation ?
- From:
- Zed A. Shaw
- Date:
- 2011-07-01 @ 22:03
On Fri, Jul 01, 2011 at 04:52:15PM +1000, Dave Dodd wrote:
> For my specific case, yes, a signal will be quite sufficient.
>
> I figured that an optional hook for a user script to do the rotation would
> give more flexibility in the myriad ways mongrel2 can be deployed.
I can add that, can you make a ticket for it in the github tickets?
--
Zed A. Shaw
http://zedshaw.com/
Re: [mongrel2] Log file rotation ?
- From:
- Dave Dodd
- Date:
- 2011-07-02 @ 04:02
On Fri, Jul 01, 2011 at 03:03:03PM -0700, Zed A. Shaw wrote:
> On Fri, Jul 01, 2011 at 04:52:15PM +1000, Dave Dodd wrote:
> > For my specific case, yes, a signal will be quite sufficient.
> >
> > I figured that an optional hook for a user script to do the rotation would
> > give more flexibility in the myriad ways mongrel2 can be deployed.
>
> I can add that, can you make a ticket for it in the github tickets?
>
> --
> Zed A. Shaw
> http://zedshaw.com/
Issue #62 opened.
--
David Dodd
Corinthian Engineering Pty Limited
Suite 54, Jones Bay Wharf
26-32 Pirrama Road
Pyrmont NSW 2009 Australia
Telephone +612 9552 5500 Fax +612 9552 5549
Re: [mongrel2] Log file rotation ?
- From:
- Matt Towers
- Date:
- 2011-07-01 @ 14:55
Logroate should do what you want. Check out the 'copytruncate' option.
copytruncate
Truncate the original log file in place after creating a copy,
instead of moving the old log file and optionally creating a new
one, It can be used when some program can not be told to close
its logfile and thus might continue writing (appending) to the
previous log file forever. Note that there is a very small time
slice between copying the file and truncating it, so some log-
ging data might be lost. When this option is used, the create
option will have no effect, as the old log file stays in place.
✈ Matt
On Jun 30, 2011, at 23:52 , Dave Dodd wrote:
> On Thu, Jun 30, 2011 at 11:33:14PM -0700, Isaac Force wrote:
>> On Thu, Jun 30, 2011 at 11:02 PM, Dave Dodd <dave@ci.com.au> wrote:
>>> What I cannot do is know that the server will close & reopen the logs on
>>> receipt of the SIGHUP from whatever log rotation tool I use.
>>>
>>> So ... I think a rotate command is in order and furthermore a hook to call a
>>> user defined rotation script should be provided as well.
>>
>> Wouldn't a signal to reload log files be sufficient? mv the logs to
>> new names (M2 should continue appending to the open inodes), send
>> SIGFOO, and the logger refreshes and creates new files as necessary.
>>
>> -Isaac
>
> For my specific case, yes, a signal will be quite sufficient.
>
> I figured that an optional hook for a user script to do the rotation would
> give more flexibility in the myriad ways mongrel2 can be deployed.
>
> -- Dave