On Thu, 8 Jul 2010 18:32:31 +0530
 Kaushal Shriyan <kaushalshri...@gmail.com> wrote:
On Thu, Jul 8, 2010 at 6:14 PM, Jacob Kjome <h...@visi.com> wrote:
On Thu, 8 Jul 2010 17:59:23 +0530
 Kaushal Shriyan <kaushalshri...@gmail.com> wrote:

On Thu, Jul 8, 2010 at 5:48 PM, Jacob Kjome <h...@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.


You're not reading closely enough.  The first example leaves off the "optional time and date".  The second example leaves off the "optional time".  Using the optional time is the key.

The Logback docs contain some more documentation on the TimeBasedRollingPolicy, which shows some time configuration.  That said, it doesn't provide an example for using a specific time of day.  You might want to post a separate thread on the Log4j-user list or even the Logback list to see if someone knows the proper syntax.  It seems like it should be possible.

http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy

You should be able to go by this documentation as both the Log4j-extras and Logback implementations have the same origin: the discontinued Log4j 1.3 effort.


Jake

Apologies for bugging

Please suggest/further

Thanks and Regards

Kaushal

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




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

Reply via email to