logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kamal Ahmed" <KAh...@webMethods.com>
Subject RE: Time stamp in file name
Date Mon, 23 Apr 2007 18:12:46 GMT
You can also use:

Timestamp File Appender

Appender creates a new log file on each start of an application, with
the additional feature that the log file name contains the current
timestamp.

Appender is pretty simple, it is derived from FileAppender and replaces
string {timestamp} from the value of File property with the current
timestamp.

Timestamp pattern is user configured by TimestampPattern property that
has the same choice of formats as java.text.SimpleDateFormat

So, the solution is very flexible.

Here are the source code and configuration example file:

TimestampFileAppender.java timestampFileAppender.configuration

Located @
http://wiki.apache.org/logging-log4j/UsefulCode

-Kamal.

-----Original Message-----
From: Hjelmstad [mailto:jeff.a.hjelmstad@mdnt.com] 
Sent: Monday, April 23, 2007 2:08 PM
To: log4j-user@logging.apache.org
Subject: Re: Time stamp in file name


Thanks for the help.


James Stauffer wrote:
> 
> My DateFormatFileAppender always includes the data pattern in the
> filename.
> http://stauffer.james.googlepages.com/DateFormatFileAppender.java
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/Time-stamp-in-file-name-tf3619129.html#a10145856
Sent from the Log4j - Users mailing list archive at Nabble.com.


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

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


Mime
View raw message