RollingFileAppender - Current Log with No Date

Hi, Is it possible to set up a RollingFileAppender so that the current log file (i.e. today's) doesn't have a date as part of the filename? Then when the log rolls over, the date is appended to the filename similar to how log4j's DailyRollingFileAppender works? Thanks!

On 04/13/2012 12:53 AM, sdoca sdoca wrote:
Hi,
Is it possible to set up a RollingFileAppender so that the current log file (i.e. today's) doesn't have a date as part of the filename? Then when the log rolls over, the date is appended to the filename similar to how log4j's DailyRollingFileAppender works?
Thanks!
Yes, that's possible, see http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy Then scoll down to the example: Example: Sample configuration of a RollingFileAppender using a TimeBasedRollingPolicy (logback-examples/src/main/java/chapters/appenders/conf/logback-RollingTimeBased.xml) -- I can't influence text below here. This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment.

Hi, I was using the RollingFileAppender, but was missing the <file> element without a date pattern so my current file had the date appended as per the <fileNamePattern> element. Thanks! ----- Original Message ----- From: Andreas Kruthoff <andreas.kruthoff@nexustelecom.com> Date: Thursday, April 12, 2012 11:57 pm Subject: Re: [logback-user] RollingFileAppender - Current Log with No Date To: logback users list <logback-user@qos.ch>
On 04/13/2012 12:53 AM, sdoca sdoca wrote:
Hi,
Is it possible to set up a RollingFileAppender so that the current log file (i.e. today's) doesn't have a date as part of the filename? Then when the log rolls over, the date is appended to the filename similar to how log4j's DailyRollingFileAppender works?
Thanks!
Yes, that's possible, see http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy
Then scoll down to the example: Example: Sample configuration of a RollingFileAppender using a TimeBasedRollingPolicy (logback-examples/src/main/java/chapters/appenders/conf/logback- RollingTimeBased.xml) -- I can't influence text below here.
This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
participants (2)
-
Andreas Kruthoff
-
sdoca sdoca