logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaushal Shriyan <kaushalshri...@gmail.com>
Subject Re: log4j
Date Thu, 08 Jul 2010 13:02:31 GMT
On Thu, Jul 8, 2010 at 6:14 PM, Jacob Kjome <hoju@visi.com> wrote:
> On Thu, 8 Jul 2010 17:59:23 +0530
>  Kaushal Shriyan <kaushalshriyan@gmail.com> wrote:
>>
>> On Thu, Jul 8, 2010 at 5:48 PM, Jacob Kjome <hoju@visi.com> wrote:
>>>
>>> When -Dlog4j.debug=true is set, Log4j prints its configuration progress
>>> to
>>> System.err.  With this, you should be able to see which config file is
>>> being
>>> picked up
>>
>> Thanks Jake.
>>
>> Thanks, I could see it on catalina.out file where in system.out and
>> system.err files goes.
>>
>>> You can run your appender at a specified time by not placing
>>> log4j.properties in the classpath.  But then you'll have to manually
>>> configure it at some later point.
>>>
>> Please help me understand by providing examples.
>>
>> Basically if i set log4j.appender.R.DatePattern='.'yyyy-MM-dd in
>> log4j.properties It rolls over at midnight. is there a way to roll
>> over at say 12:00 Noon afternoon
>>
>
> Oh, I see.  Sorry, I thought you were asking if you could delay
> instantiation of your appender.  Rather, you want to define when it rolls.
> See:
>
> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html
>
> As you can see, DailyRollingFileAppender is somewhat lacking in
> flexibility.  You may have more luck with the Log4j-extras companion [1].
> Specifically, RollingFileAppender [2] with a TimeBasedRollingPolicy [3].
>
> [1] http://logging.apache.org/log4j/companions/extras/index.html
> [2]
> http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html
> [3]
> http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html
>
>
> Jake

Jake,

I referred to http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html
it has only two options

/wombat/folder/foo.%d (Daily rollover (at midnight). Due to the
omission of the optional time and date pattern for the %d token
specifier, the default pattern of "yyyy-MM-dd" is assumed, which
corresponds to daily rollover.)

/wombat/foo.%d{yyyy-MM}.log (Rollover at the beginning of each month.)

Not sure though how it would fit it into my specific needs.

Apologies for bugging

Please suggest/further

Thanks and Regards

Kaushal

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


Mime
View raw message