You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Mike Morgan <mm...@lucent.com> on 2005/09/02 20:00:59 UTC
Setting a callback for log rollover
I have a pretty fundamental problem but can not find any discussion
about it. My application needs to be notified by log4j of when it is
rolling files over so I can stick standard preamble stuff into the file
(application version, machine information, etc.)
How can I specify a callback or some notification mechanism that
would do this? The only potential solution I see would be create a
LoggerFactory that creates objects that have overridden rollover method,
but this causes other problems.
thanks,
Mike Morgan
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Setting a callback for log rollover
Posted by James Stauffer <st...@gmail.com>.
You could overwrite RollingFilerAppender to catch that event and add
your extra info.
On 9/2/05, Mike Morgan <mm...@lucent.com> wrote:
>
> I have a pretty fundamental problem but can not find any discussion
> about it. My application needs to be notified by log4j of when it is
> rolling files over so I can stick standard preamble stuff into the file
> (application version, machine information, etc.)
>
> How can I specify a callback or some notification mechanism that
> would do this? The only potential solution I see would be create a
> LoggerFactory that creates objects that have overridden rollover method,
> but this causes other problems.
>
> thanks,
> Mike Morgan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org