Re: Handling a change in system date
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Sat, 26 Jan 2008 12:23:59 -0500
james schrieb:
I'm relatively new to java so I apologise if this is a simple
question. I am trying to detect when the system date changes so that I
can start a new log file for each day. I have setup the code to create
a new log file etc. however I can't seem to find any information on
how to detect changes in the system date. I am only interested in when
the day changes (not the time etc.) and I have looked into change
listeners however I'm not sure if this is the right approach or not?
Can anyone please point me in the right direction, or even better to a
good tutorial on how to do this!
Christian wrote:
<http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html>
Aside from the obvious answer, if you must roll your own, have the appender check the date of the file before writing to it. If it's from the previous day, open a new file.
--
Lew
.
- References:
- Handling a change in system date
- From: james
- Re: Handling a change in system date
- From: Christian
- Handling a change in system date
- Prev by Date: Re: Java database
- Next by Date: Re: Graphics help please
- Previous by thread: Re: Handling a change in system date
- Next by thread: Re: Handling a change in system date
- Index(es):
Relevant Pages
|