Your Java program has to be "continually" running.  If you run your program
once, change the date, and run it again, the program doesn't consider that
the date changes.



                                                                                       
                               
                    "John Haleani"                                                     
                               
                    <johnhaleani@ho        To:     [EMAIL PROTECTED]       
                               
                    tmail.com>             cc:                                         
                               
                                           Subject:     DailyRollingFileAppender       
                               
                    01/09/2002                                                         
                               
                    03:01 PM                                                           
                               
                    Please respond                                                     
                               
                    to "Log4J Users                                                    
                               
                    List"                                                              
                               
                                                                                       
                               
                                                                                       
                               



I'm trying to use the DailyRollingFileAppender, but am having some
problems.
I couldn't find any information in the online manual so I'm sending this
message to the list. Any help would be appreciated.

Log4J Version: 1.1.3

Properties File:

log4j.rootCategory=DEBUG, File
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.DatePattern="'.'yyyy-MM-dd"
log4j.appender.File.File=D:/Temp/messages.log
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%-5p %d{yyyy-MM-dd
HH:mm:ss.SSSS z} %c{3}: %m%n
log4j.appender.File.Threshold=DEBUG

Pre-Test:

I'm manually removing D:/Temp/messages.log file.

Testing Scenario:

Then I run a test which creates a new D:/Temp/messages.log file and places
a
log message it. So far so good. I want to test the rolling over of this
file, so I then change the date on my PC to tomorrow. I then run another
test and expect to see 2 files: messages.log.2002-01-09 and messages.log.
However, I only see the messages.log file with all messages in it ( i.e.
"yesterday's" and "today's"):

DEBUG 2002-01-09 11:35:15.0843 PST john.test.Log4JTester: X
DEBUG 2002-01-10 11:35:44.0187 PST john.test.Log4JTester: X

Any ideas as to why the file does not rollover in this situation?

Thanks.

John

_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to