You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Brian Neradt <br...@gmail.com> on 2020/01/23 17:16:25 UTC
Proposal for 9.x: Support external log rotation via a handled signal
Context
======
Traffic Server currently implements its own mechanism for rotating its logs
and cleaning up (i.e., deleting) rotated logs based upon configured
constraints. These features seem to have been developed at a time when
third party tools for managing such logs were non-existent or immature.
Today administrators have tools such as logrotate they can use to manage
logs. Such tools handle log rotation and deletion (and compression,
automated emailing, and other related features) in a way that
administrators are generally familiar with and would prefer to use for
consistency across their log management needs. After rotating their logs,
these tools send a signal to the process generating the logs so they can
close and re-open the logs. Traffic Server does not currently support
external log managers because it does not support listening for such
signals.
Proposal
=======
In order to support the use of tools such as logrotate, this proposal
suggests adding support for Traffic Manager and Traffic Server to handle a
signal that causes those processes to close and re-open their logs handles.
Further, while SIGHUP is a pretty common signal used for such purposes,
this proposes SIGUSR2 instead since we already use that for traffic.out
(added via https://github.com/apache/trafficserver/pull/274/files).
Please share any thoughts or suggestions.
Thanks,
Brian
--
"Come to Me, all who are weary and heavy-laden, and I will
give you rest. Take My yoke upon you and learn from Me, for
I am gentle and humble in heart, and you will find rest for
your souls. For My yoke is easy and My burden is light."
~ Matthew 11:28-30
Re: Proposal for 9.x: Support external log rotation via a handled signal
Posted by Sudheer Vinukonda <su...@yahoo.com.INVALID>.
+1
> On Jan 24, 2020, at 10:12 AM, David Calavera <da...@gmail.com> wrote:
>
> Great idea. +1
>
>> On Fri, Jan 24, 2020 at 10:06 AM Steven R. Feltner <sf...@godaddy.com>
>> wrote:
>>
>>
>> +1
>>
>> On 1/24/20, 10:43 AM, "Leif Hedstrom" <zw...@apache.org> wrote:
>>
>>>> On Jan 24, 2020, at 10:06 AM, Bryan Call <bc...@apache.org> wrote:
>>>
>>> +1 - supports the UNIX Philosophy of having each program do one
>> thing well
>>
>> +1.
>>
>> Someone please tell that to the systemd people too …
>>
>> — Leif
>>
>>>
>>> -Bryan
>>>
>>>
>>>> On Jan 23, 2020, at 9:16 AM, Brian Neradt <br...@gmail.com>
>> wrote:
>>>>
>>>> Context
>>>> ======
>>>>
>>>> Traffic Server currently implements its own mechanism for rotating
>> its logs
>>>> and cleaning up (i.e., deleting) rotated logs based upon configured
>>>> constraints. These features seem to have been developed at a time
>> when
>>>> third party tools for managing such logs were non-existent or
>> immature.
>>>> Today administrators have tools such as logrotate they can use to
>> manage
>>>> logs. Such tools handle log rotation and deletion (and compression,
>>>> automated emailing, and other related features) in a way that
>>>> administrators are generally familiar with and would prefer to use
>> for
>>>> consistency across their log management needs. After rotating their
>> logs,
>>>> these tools send a signal to the process generating the logs so
>> they can
>>>> close and re-open the logs. Traffic Server does not currently
>> support
>>>> external log managers because it does not support listening for such
>>>> signals.
>>>>
>>>> Proposal
>>>> =======
>>>>
>>>> In order to support the use of tools such as logrotate, this
>> proposal
>>>> suggests adding support for Traffic Manager and Traffic Server to
>> handle a
>>>> signal that causes those processes to close and re-open their logs
>> handles.
>>>>
>>>> Further, while SIGHUP is a pretty common signal used for such
>> purposes,
>>>> this proposes SIGUSR2 instead since we already use that for
>> traffic.out
>>>> (added via https://github.com/apache/trafficserver/pull/274/files).
>>>>
>>>>
>>>> Please share any thoughts or suggestions.
>>>>
>>>> Thanks,
>>>> Brian
>>>> --
>>>> "Come to Me, all who are weary and heavy-laden, and I will
>>>> give you rest. Take My yoke upon you and learn from Me, for
>>>> I am gentle and humble in heart, and you will find rest for
>>>> your souls. For My yoke is easy and My burden is light."
>>>>
>>>> ~ Matthew 11:28-30
>>>
>>
>>
>>
>>
Re: Proposal for 9.x: Support external log rotation via a handled signal
Posted by David Calavera <da...@gmail.com>.
Great idea. +1
On Fri, Jan 24, 2020 at 10:06 AM Steven R. Feltner <sf...@godaddy.com>
wrote:
>
> +1
>
> On 1/24/20, 10:43 AM, "Leif Hedstrom" <zw...@apache.org> wrote:
>
> > On Jan 24, 2020, at 10:06 AM, Bryan Call <bc...@apache.org> wrote:
> >
> > +1 - supports the UNIX Philosophy of having each program do one
> thing well
>
> +1.
>
> Someone please tell that to the systemd people too …
>
> — Leif
>
> >
> > -Bryan
> >
> >
> >> On Jan 23, 2020, at 9:16 AM, Brian Neradt <br...@gmail.com>
> wrote:
> >>
> >> Context
> >> ======
> >>
> >> Traffic Server currently implements its own mechanism for rotating
> its logs
> >> and cleaning up (i.e., deleting) rotated logs based upon configured
> >> constraints. These features seem to have been developed at a time
> when
> >> third party tools for managing such logs were non-existent or
> immature.
> >> Today administrators have tools such as logrotate they can use to
> manage
> >> logs. Such tools handle log rotation and deletion (and compression,
> >> automated emailing, and other related features) in a way that
> >> administrators are generally familiar with and would prefer to use
> for
> >> consistency across their log management needs. After rotating their
> logs,
> >> these tools send a signal to the process generating the logs so
> they can
> >> close and re-open the logs. Traffic Server does not currently
> support
> >> external log managers because it does not support listening for such
> >> signals.
> >>
> >> Proposal
> >> =======
> >>
> >> In order to support the use of tools such as logrotate, this
> proposal
> >> suggests adding support for Traffic Manager and Traffic Server to
> handle a
> >> signal that causes those processes to close and re-open their logs
> handles.
> >>
> >> Further, while SIGHUP is a pretty common signal used for such
> purposes,
> >> this proposes SIGUSR2 instead since we already use that for
> traffic.out
> >> (added via https://github.com/apache/trafficserver/pull/274/files).
> >>
> >>
> >> Please share any thoughts or suggestions.
> >>
> >> Thanks,
> >> Brian
> >> --
> >> "Come to Me, all who are weary and heavy-laden, and I will
> >> give you rest. Take My yoke upon you and learn from Me, for
> >> I am gentle and humble in heart, and you will find rest for
> >> your souls. For My yoke is easy and My burden is light."
> >>
> >> ~ Matthew 11:28-30
> >
>
>
>
>
Re: Proposal for 9.x: Support external log rotation via a handled
signal
Posted by "Steven R. Feltner" <sf...@godaddy.com>.
+1
On 1/24/20, 10:43 AM, "Leif Hedstrom" <zw...@apache.org> wrote:
> On Jan 24, 2020, at 10:06 AM, Bryan Call <bc...@apache.org> wrote:
>
> +1 - supports the UNIX Philosophy of having each program do one thing well
+1.
Someone please tell that to the systemd people too …
— Leif
>
> -Bryan
>
>
>> On Jan 23, 2020, at 9:16 AM, Brian Neradt <br...@gmail.com> wrote:
>>
>> Context
>> ======
>>
>> Traffic Server currently implements its own mechanism for rotating its logs
>> and cleaning up (i.e., deleting) rotated logs based upon configured
>> constraints. These features seem to have been developed at a time when
>> third party tools for managing such logs were non-existent or immature.
>> Today administrators have tools such as logrotate they can use to manage
>> logs. Such tools handle log rotation and deletion (and compression,
>> automated emailing, and other related features) in a way that
>> administrators are generally familiar with and would prefer to use for
>> consistency across their log management needs. After rotating their logs,
>> these tools send a signal to the process generating the logs so they can
>> close and re-open the logs. Traffic Server does not currently support
>> external log managers because it does not support listening for such
>> signals.
>>
>> Proposal
>> =======
>>
>> In order to support the use of tools such as logrotate, this proposal
>> suggests adding support for Traffic Manager and Traffic Server to handle a
>> signal that causes those processes to close and re-open their logs handles.
>>
>> Further, while SIGHUP is a pretty common signal used for such purposes,
>> this proposes SIGUSR2 instead since we already use that for traffic.out
>> (added via https://github.com/apache/trafficserver/pull/274/files).
>>
>>
>> Please share any thoughts or suggestions.
>>
>> Thanks,
>> Brian
>> --
>> "Come to Me, all who are weary and heavy-laden, and I will
>> give you rest. Take My yoke upon you and learn from Me, for
>> I am gentle and humble in heart, and you will find rest for
>> your souls. For My yoke is easy and My burden is light."
>>
>> ~ Matthew 11:28-30
>
Re: Proposal for 9.x: Support external log rotation via a handled
signal
Posted by Leif Hedstrom <zw...@apache.org>.
> On Jan 24, 2020, at 10:06 AM, Bryan Call <bc...@apache.org> wrote:
>
> +1 - supports the UNIX Philosophy of having each program do one thing well
+1.
Someone please tell that to the systemd people too …
— Leif
>
> -Bryan
>
>
>> On Jan 23, 2020, at 9:16 AM, Brian Neradt <br...@gmail.com> wrote:
>>
>> Context
>> ======
>>
>> Traffic Server currently implements its own mechanism for rotating its logs
>> and cleaning up (i.e., deleting) rotated logs based upon configured
>> constraints. These features seem to have been developed at a time when
>> third party tools for managing such logs were non-existent or immature.
>> Today administrators have tools such as logrotate they can use to manage
>> logs. Such tools handle log rotation and deletion (and compression,
>> automated emailing, and other related features) in a way that
>> administrators are generally familiar with and would prefer to use for
>> consistency across their log management needs. After rotating their logs,
>> these tools send a signal to the process generating the logs so they can
>> close and re-open the logs. Traffic Server does not currently support
>> external log managers because it does not support listening for such
>> signals.
>>
>> Proposal
>> =======
>>
>> In order to support the use of tools such as logrotate, this proposal
>> suggests adding support for Traffic Manager and Traffic Server to handle a
>> signal that causes those processes to close and re-open their logs handles.
>>
>> Further, while SIGHUP is a pretty common signal used for such purposes,
>> this proposes SIGUSR2 instead since we already use that for traffic.out
>> (added via https://github.com/apache/trafficserver/pull/274/files).
>>
>>
>> Please share any thoughts or suggestions.
>>
>> Thanks,
>> Brian
>> --
>> "Come to Me, all who are weary and heavy-laden, and I will
>> give you rest. Take My yoke upon you and learn from Me, for
>> I am gentle and humble in heart, and you will find rest for
>> your souls. For My yoke is easy and My burden is light."
>>
>> ~ Matthew 11:28-30
>
Re: Proposal for 9.x: Support external log rotation via a handled
signal
Posted by Bryan Call <bc...@apache.org>.
+1 - supports the UNIX Philosophy of having each program do one thing well
-Bryan
> On Jan 23, 2020, at 9:16 AM, Brian Neradt <br...@gmail.com> wrote:
>
> Context
> ======
>
> Traffic Server currently implements its own mechanism for rotating its logs
> and cleaning up (i.e., deleting) rotated logs based upon configured
> constraints. These features seem to have been developed at a time when
> third party tools for managing such logs were non-existent or immature.
> Today administrators have tools such as logrotate they can use to manage
> logs. Such tools handle log rotation and deletion (and compression,
> automated emailing, and other related features) in a way that
> administrators are generally familiar with and would prefer to use for
> consistency across their log management needs. After rotating their logs,
> these tools send a signal to the process generating the logs so they can
> close and re-open the logs. Traffic Server does not currently support
> external log managers because it does not support listening for such
> signals.
>
> Proposal
> =======
>
> In order to support the use of tools such as logrotate, this proposal
> suggests adding support for Traffic Manager and Traffic Server to handle a
> signal that causes those processes to close and re-open their logs handles.
>
> Further, while SIGHUP is a pretty common signal used for such purposes,
> this proposes SIGUSR2 instead since we already use that for traffic.out
> (added via https://github.com/apache/trafficserver/pull/274/files).
>
>
> Please share any thoughts or suggestions.
>
> Thanks,
> Brian
> --
> "Come to Me, all who are weary and heavy-laden, and I will
> give you rest. Take My yoke upon you and learn from Me, for
> I am gentle and humble in heart, and you will find rest for
> your souls. For My yoke is easy and My burden is light."
>
> ~ Matthew 11:28-30
Re: Proposal for 9.x: Support external log rotation via a handled
signal
Posted by Leif Hedstrom <zw...@apache.org>.
> On Jan 23, 2020, at 11:09 AM, Derek Dagit <da...@apache.org> wrote:
>
> +1 for concept and rationale
>
> Might be good to survey the common log rotation tools to verify custom
> signals are supported.
>
> On Thu, Jan 23, 2020 at 11:16:25AM -0600, Brian Neradt wrote:
>>
>> Context
>> ======
>>
>> Traffic Server currently implements its own mechanism for rotating its logs
>> and cleaning up (i.e., deleting) rotated logs based upon configured
>> constraints. These features seem to have been developed at a time when
>> third party tools for managing such logs were non-existent or immature.
>> Today administrators have tools such as logrotate they can use to manage
>> logs. Such tools handle log rotation and deletion (and compression,
>> automated emailing, and other related features) in a way that
>> administrators are generally familiar with and would prefer to use for
>> consistency across their log management needs. After rotating their logs,
>> these tools send a signal to the process generating the logs so they can
>> close and re-open the logs. Traffic Server does not currently support
>> external log managers because it does not support listening for such
>> signals.
>>
>> Proposal
>> =======
>>
>> In order to support the use of tools such as logrotate, this proposal
>> suggests adding support for Traffic Manager and Traffic Server to handle a
>> signal that causes those processes to close and re-open their logs handles.
>>
>> Further, while SIGHUP is a pretty common signal used for such purposes,
>> this proposes SIGUSR2 instead since we already use that for traffic.out
>> (added via https://github.com/apache/trafficserver/pull/274/files).
Also, for this change, it’d be fine to rearrange which signal is used for what. SIGHUP is by far the most common way to do log rotation, and it’d be unorthodox to not use it IMO. We can move our existing usage of HUP over to e.g. USR1/2 etc.
Cheers,
— leif
>>
>>
>> Please share any thoughts or suggestions.
>>
>> Thanks,
>> Brian
>> --
>> "Come to Me, all who are weary and heavy-laden, and I will
>> give you rest. Take My yoke upon you and learn from Me, for
>> I am gentle and humble in heart, and you will find rest for
>> your souls. For My yoke is easy and My burden is light."
>>
>> ~ Matthew 11:28-30
Re: Proposal for 9.x: Support external log rotation via a handled signal
Posted by Alan Carroll <so...@verizonmedia.com.INVALID>.
IN the long run, yes, we may want to make the signal different or
configurable. Our current plan is to try this internally first and see how
the ops guys like it, or if they have problems making it work. At this
point, going with SIGUSR2 is IMHO the best option, because the cost of
fixing it later is low.
On Thu, Jan 23, 2020 at 1:36 PM Brian Neradt <br...@gmail.com> wrote:
> Thanks. Good point about the custom signal: logrotate and newsyslog seem to
> be the most popular log rotation utilities and they both support a custom
> signal.
>
> On Thu, Jan 23, 2020 at 12:09 PM Derek Dagit <da...@apache.org> wrote:
>
> > +1 for concept and rationale
> >
> > Might be good to survey the common log rotation tools to verify custom
> > signals are supported.
> >
> > On Thu, Jan 23, 2020 at 11:16:25AM -0600, Brian Neradt wrote:
> > >
> > > Context
> > > ======
> > >
> > > Traffic Server currently implements its own mechanism for rotating its
> > logs
> > > and cleaning up (i.e., deleting) rotated logs based upon configured
> > > constraints. These features seem to have been developed at a time when
> > > third party tools for managing such logs were non-existent or immature.
> > > Today administrators have tools such as logrotate they can use to
> manage
> > > logs. Such tools handle log rotation and deletion (and compression,
> > > automated emailing, and other related features) in a way that
> > > administrators are generally familiar with and would prefer to use for
> > > consistency across their log management needs. After rotating their
> logs,
> > > these tools send a signal to the process generating the logs so they
> can
> > > close and re-open the logs. Traffic Server does not currently support
> > > external log managers because it does not support listening for such
> > > signals.
> > >
> > > Proposal
> > > =======
> > >
> > > In order to support the use of tools such as logrotate, this proposal
> > > suggests adding support for Traffic Manager and Traffic Server to
> handle
> > a
> > > signal that causes those processes to close and re-open their logs
> > handles.
> > >
> > > Further, while SIGHUP is a pretty common signal used for such purposes,
> > > this proposes SIGUSR2 instead since we already use that for traffic.out
> > > (added via https://github.com/apache/trafficserver/pull/274/files).
> > >
> > >
> > > Please share any thoughts or suggestions.
> > >
> > > Thanks,
> > > Brian
> > > --
> > > "Come to Me, all who are weary and heavy-laden, and I will
> > > give you rest. Take My yoke upon you and learn from Me, for
> > > I am gentle and humble in heart, and you will find rest for
> > > your souls. For My yoke is easy and My burden is light."
> > >
> > > ~ Matthew 11:28-30
> >
>
>
> --
> "Come to Me, all who are weary and heavy-laden, and I will
> give you rest. Take My yoke upon you and learn from Me, for
> I am gentle and humble in heart, and you will find rest for
> your souls. For My yoke is easy and My burden is light."
>
> ~ Matthew 11:28-30
>
Re: Proposal for 9.x: Support external log rotation via a handled signal
Posted by Brian Neradt <br...@gmail.com>.
Thanks. Good point about the custom signal: logrotate and newsyslog seem to
be the most popular log rotation utilities and they both support a custom
signal.
On Thu, Jan 23, 2020 at 12:09 PM Derek Dagit <da...@apache.org> wrote:
> +1 for concept and rationale
>
> Might be good to survey the common log rotation tools to verify custom
> signals are supported.
>
> On Thu, Jan 23, 2020 at 11:16:25AM -0600, Brian Neradt wrote:
> >
> > Context
> > ======
> >
> > Traffic Server currently implements its own mechanism for rotating its
> logs
> > and cleaning up (i.e., deleting) rotated logs based upon configured
> > constraints. These features seem to have been developed at a time when
> > third party tools for managing such logs were non-existent or immature.
> > Today administrators have tools such as logrotate they can use to manage
> > logs. Such tools handle log rotation and deletion (and compression,
> > automated emailing, and other related features) in a way that
> > administrators are generally familiar with and would prefer to use for
> > consistency across their log management needs. After rotating their logs,
> > these tools send a signal to the process generating the logs so they can
> > close and re-open the logs. Traffic Server does not currently support
> > external log managers because it does not support listening for such
> > signals.
> >
> > Proposal
> > =======
> >
> > In order to support the use of tools such as logrotate, this proposal
> > suggests adding support for Traffic Manager and Traffic Server to handle
> a
> > signal that causes those processes to close and re-open their logs
> handles.
> >
> > Further, while SIGHUP is a pretty common signal used for such purposes,
> > this proposes SIGUSR2 instead since we already use that for traffic.out
> > (added via https://github.com/apache/trafficserver/pull/274/files).
> >
> >
> > Please share any thoughts or suggestions.
> >
> > Thanks,
> > Brian
> > --
> > "Come to Me, all who are weary and heavy-laden, and I will
> > give you rest. Take My yoke upon you and learn from Me, for
> > I am gentle and humble in heart, and you will find rest for
> > your souls. For My yoke is easy and My burden is light."
> >
> > ~ Matthew 11:28-30
>
--
"Come to Me, all who are weary and heavy-laden, and I will
give you rest. Take My yoke upon you and learn from Me, for
I am gentle and humble in heart, and you will find rest for
your souls. For My yoke is easy and My burden is light."
~ Matthew 11:28-30
Re: Proposal for 9.x: Support external log rotation via a handled
signal
Posted by Derek Dagit <da...@apache.org>.
+1 for concept and rationale
Might be good to survey the common log rotation tools to verify custom
signals are supported.
On Thu, Jan 23, 2020 at 11:16:25AM -0600, Brian Neradt wrote:
>
> Context
> ======
>
> Traffic Server currently implements its own mechanism for rotating its logs
> and cleaning up (i.e., deleting) rotated logs based upon configured
> constraints. These features seem to have been developed at a time when
> third party tools for managing such logs were non-existent or immature.
> Today administrators have tools such as logrotate they can use to manage
> logs. Such tools handle log rotation and deletion (and compression,
> automated emailing, and other related features) in a way that
> administrators are generally familiar with and would prefer to use for
> consistency across their log management needs. After rotating their logs,
> these tools send a signal to the process generating the logs so they can
> close and re-open the logs. Traffic Server does not currently support
> external log managers because it does not support listening for such
> signals.
>
> Proposal
> =======
>
> In order to support the use of tools such as logrotate, this proposal
> suggests adding support for Traffic Manager and Traffic Server to handle a
> signal that causes those processes to close and re-open their logs handles.
>
> Further, while SIGHUP is a pretty common signal used for such purposes,
> this proposes SIGUSR2 instead since we already use that for traffic.out
> (added via https://github.com/apache/trafficserver/pull/274/files).
>
>
> Please share any thoughts or suggestions.
>
> Thanks,
> Brian
> --
> "Come to Me, all who are weary and heavy-laden, and I will
> give you rest. Take My yoke upon you and learn from Me, for
> I am gentle and humble in heart, and you will find rest for
> your souls. For My yoke is easy and My burden is light."
>
> ~ Matthew 11:28-30