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 minaret <mi...@sprynet.com> on 2004/09/06 18:39:36 UTC

New Log4j appender available

I have written a new Log4j appender (DatedFileAppender) that works in the 
same manner as the Tomcat FileLogger. That is, log file names always contain 
today's date instead of being renamed in the manner of the 
DailyRollingFileAppender. While this distinction seems minor, it means you 
can reliably copy, compress, remove or manipulate a day's log file shortly 
after midnight. With the DailyRollingFileAppender, a day's log file is not 
renamed until the first message is logged some time after midnight.

The software and accompanying documentation is available here:

     http://minaret.biz/tips/datedFileAppender.html

For those of you using Tomcat, I also wrote up a technical tip on Tomcat 
logging and using Log4j with Tomcat (with tips for Velocity users). Please see:

     http://minaret.biz/tips/tomcatLogging.html

Enjoy.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: New Log4j appender available

Posted by minaret <mi...@sprynet.com>.
>> I don't have any knowledge of the new rolling package. I based my 
>> implementation on the current 1.2.8 distribution of Log4j. I would be 
>> happy to have a look at the new rolling package once it becomes 
>> available (it doesn't seem to be part of 1.2.8).
> 
> 
> Hi Geoff,
> 
> It is available in log4j version 1.3. You can get 1.3 from CVS. I'll be 
> happy to add DatedFileAppender to 1.3 assuming it is compatible with the 
> new rolling package structure.
> 
> Your comments on the new package would also be most welcome.

Thanks Ceki. It will take a couple of days but I'll give it a try.

Best,

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: New Log4j appender available

Posted by Ceki Gülcü <ce...@qos.ch>.
At 09:19 PM 9/6/2004, minaret wrote:
>I don't have any knowledge of the new rolling package. I based my 
>implementation on the current 1.2.8 distribution of Log4j. I would be 
>happy to have a look at the new rolling package once it becomes available 
>(it doesn't seem to be part of 1.2.8).

Hi Geoff,

It is available in log4j version 1.3. You can get 1.3 from CVS. I'll be 
happy to add DatedFileAppender to 1.3 assuming it is compatible with the 
new rolling package structure.

Your comments on the new package would also be most welcome.


-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: New Log4j appender available

Posted by minaret <mi...@sprynet.com>.
> Thanks for the information. I'll add a link from our web-site to your 
> documents.

Thank you.

> Have you considered updating your DatedFileAppender with the new rolling 
> appenders in the o.a.l.rolling package? The classes derived from 
> o.a.log4j.RollingFileAppender have been deprecated. New and more 
> flexible alternatives are available in o.a.log4j.rolling.

I don't have any knowledge of the new rolling package. I based my 
implementation on the current 1.2.8 distribution of Log4j. I would be happy 
to have a look at the new rolling package once it becomes available (it 
doesn't seem to be part of 1.2.8).

minaret


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: New Log4j appender available

Posted by Geoff <mi...@sprynet.com>.
> Have you considered updating your DatedFileAppender with the new rolling 
> appenders in the o.a.l.rolling package? The classes derived from 
> o.a.log4j.RollingFileAppender have been deprecated. New and more 
> flexible alternatives are available in o.a.log4j.rolling.

Please note that DatedFileAppender extends FileAppender and not 
RollingFileAppender. I downloaded version 1.3 and DatedFileAppender works 
with the new code.

I had a look at the rolling code. From what I can tell the principle design 
is the same as before. You start with a base file and rename it periodically 
(I see that you have added compression capabilities as well). I like how you 
have moved the triggers and policies into separate classes.

What would be a very useful feature would be a configuration option for all 
of the rolling loggers (but especially useful for the time based loggers) 
that would cause the logger to use the formatted file name with a number or 
date right away (the way the Tomcat FileLogger does) instead of renaming a 
base file name to one with a number or date. This would eliminate the need 
for my DatedFileAppender and would extend the flexibility of Log4j quite a bit.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: New Log4j appender available

Posted by Ceki Gülcü <ce...@qos.ch>.
Hi,

Thanks for the information. I'll add a link from our web-site to your 
documents.

Have you considered updating your DatedFileAppender with the new rolling 
appenders in the o.a.l.rolling package? The classes derived from 
o.a.log4j.RollingFileAppender have been deprecated. New and more flexible 
alternatives are available in o.a.log4j.rolling.

At 06:39 PM 9/6/2004, minaret wrote:
>I have written a new Log4j appender (DatedFileAppender) that works in the 
>same manner as the Tomcat FileLogger. That is, log file names always 
>contain today's date instead of being renamed in the manner of the 
>DailyRollingFileAppender. While this distinction seems minor, it means you 
>can reliably copy, compress, remove or manipulate a day's log file shortly 
>after midnight. With the DailyRollingFileAppender, a day's log file is not 
>renamed until the first message is logged some time after midnight.
>
>The software and accompanying documentation is available here:
>
>     http://minaret.biz/tips/datedFileAppender.html
>
>For those of you using Tomcat, I also wrote up a technical tip on Tomcat 
>logging and using Log4j with Tomcat (with tips for Velocity users). Please see:
>
>     http://minaret.biz/tips/tomcatLogging.html
>
>Enjoy.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org