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 Wendy Smoak <We...@asu.edu> on 2002/12/20 17:38:48 UTC

DailyRollingFileAppender won't ROLL!

I'm sure I have a configuration problem, but I've tried many examples and
nothing works.  All of the log messages are going to a single file and it
will not roll over.  I'm currently trying to get it to roll every minute so
that I can test it, but once that works I will change it to daily or weekly.

I'm using log4j underneath commons-logging, but that shouldn't matter... it
is picking up this properties file, which I've tested by changing the
ConversionPattern and seeing the change in the logs.  I have log4j version
1.1.3.

log4j.properties:

# Create an appender called daily:
log4j.rootLogger=DEBUG, daily

# Create a category for each class, set the level and appender:
log4j.category.test.LoggingTest=DEBUG, daily
# ... lots of lines deleted ...
log4j.category.edu.asu.vpia.struts.ViewProfileAction=DEBUG, daily

# Configure the daily appender to be a DailyRollingFileAppender
log4j.appender.daily=org.apache.log4j.DailyRollingFileAppender

# Configure the name of the logout for the daily appender
# default location when used with Tomcat is is /path/to/tomcat/bin, 
# so back up one & go into logs
log4j.appender.daily.File=../logs/bendev.log

# Configure the layout pattern and conversion pattern for the daily appender
log4j.appender.daily.layout=org.apache.log4j.PatternLayout
log4j.appender.daily.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n

# Roll the file over daily:
#log4j.appender.daily.DateFormat='.'yyyy-MM-dd
#log4j.appender.daily.datePattern='.'yyyy-MM-dd
#log4j.appender.daily.DatePattern='.'yyyy-MM-dd
log4j.appender.daily.DatePattern='.'yyyy-MM-dd-HH-mm 

I'm guessing it's this last line that's wrong.  Can anyone help?

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

Re: DailyRollingFileAppender won't ROLL!

Posted by Josh Kleinpeter <kl...@corp.earthlink.net>.
Wendy Smoak wrote:

>I'm sure I have a configuration problem, but I've tried many examples and
>nothing works.  All of the log messages are going to a single file and it
>will not roll over.  I'm currently trying to get it to roll every minute so
>that I can test it, but once that works I will change it to daily or weekly.
>
>I'm using log4j underneath commons-logging, but that shouldn't matter... it
>is picking up this properties file, which I've tested by changing the
>ConversionPattern and seeing the change in the logs.  I have log4j version
>1.1.3.
>
>log4j.properties:
>
># Create an appender called daily:
>log4j.rootLogger=DEBUG, daily
>
># Create a category for each class, set the level and appender:
>log4j.category.test.LoggingTest=DEBUG, daily
># ... lots of lines deleted ...
>log4j.category.edu.asu.vpia.struts.ViewProfileAction=DEBUG, daily
>
># Configure the daily appender to be a DailyRollingFileAppender
>log4j.appender.daily=org.apache.log4j.DailyRollingFileAppender
>
># Configure the name of the logout for the daily appender
># default location when used with Tomcat is is /path/to/tomcat/bin, 
># so back up one & go into logs
>log4j.appender.daily.File=../logs/bendev.log
>
># Configure the layout pattern and conversion pattern for the daily appender
>log4j.appender.daily.layout=org.apache.log4j.PatternLayout
>log4j.appender.daily.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n
>
># Roll the file over daily:
>#log4j.appender.daily.DateFormat='.'yyyy-MM-dd
>#log4j.appender.daily.datePattern='.'yyyy-MM-dd
>#log4j.appender.daily.DatePattern='.'yyyy-MM-dd
>log4j.appender.daily.DatePattern='.'yyyy-MM-dd-HH-mm 
>
>I'm guessing it's this last line that's wrong.  Can anyone help?
>
>  
>
You shouldn't be quoting the . in your pattern.

log4j.appender.daily.DatePattern=.yyyy-MM-dd-HH-mm 

should work fine.



-- 
josh kleinpeter    | sr software engineer
web infrastructure | earthlink.net

Superior intelligence and senseless cruelty just do not go together.
  -- Dr. Who



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>