Click to See Complete Forum and Search --> : Need some help with log4j


chazzy
09-25-2006, 12:11 PM
All,

I know that I should probably try contacting them first, but the documentation on log4j seems vague.

What I want to do is have a daily rotating log. I need to create it for Appenders A,B, and C.

The descriptions for A, B, and C are supposed to look like this


log4j.appender.A=org.apache.log4j.RollingFileAppender
log4j.appender.A.File=example.log
log4j.appender.A.layout=org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern=%p %t %c - %m%n


What I don't get is how to implement time based rolling logs, like everyday at midnight create a new log.

Khalid Ali
09-25-2006, 07:17 PM
All,


log4j.appender.A=org.apache.log4j.RollingFileAppender


.

instead of the above use the following,

log4j.appender.R=org.apache.log4j.DailyRollingFileAppender

Read the API for all of the options available for you to use.

chazzy
09-25-2006, 08:13 PM
is that from 1.3 or 1.2? Based on the information the guide was giving, DailyRolling is only available from 1.3 and later. We might be limited to 1.2 in our case, it's not clear yet.