You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Rob Richardson <Ro...@rad-con.com> on 2010/07/28 21:56:56 UTC

Rotated file name control

Greetings!

I am using a rotating file log.  The current file is TrendMasterCS.log.
Yesterday's file is TrendMasterCS.log.2010-07-10.  Since the default
action for a file is based on its extension, I would prefer the rotated
file name to be TrendMasterCS.2010-07-10.log.  I didn't see a way to
control that.  Can it be controlled?

Thank you.

RobR

RE: Rotated file name control

Posted by Rob Richardson <Ro...@rad-con.com>.
Thank you! 


Robert D. Richardson
Product Engineer Software
 
RAD-CON, Inc.
TECHNOLOGY: Innovative & Proven
Phone : +1.440.871.5720 ... ext 123
Fax:  +1.440.871.2948
Website:  www.RAD-CON.com
E-mail:  rob.richardson@RAD-CON.com


-----Original Message-----
From: Lansdaal, Michael T [mailto:michael.t.lansdaal@boeing.com] 
Sent: Thursday, July 29, 2010 10:02 AM
To: log4net-user@logging.apache.org
Subject: RE: Rotated file name control

Rob - I use the RollingFileAppender and set the date pattern so that I
get a .log extension.

<appender name="RollingDebugLogFileAppender"
type="log4net.Appender.RollingFileAppender">
	<file value="TrendMasterCS" />
	<appendToFile value="true" />
	<rollingStyle value="Composite" />
	<staticLogFileName value="false" />
	<datePattern value=".yyyy-MM-dd.lo\g" />

Thanks, Mike 

-----Original Message-----
From: Rob Richardson [mailto:Rob.Richardson@rad-con.com]
Sent: Wednesday, July 28, 2010 12:57 PM
To: Log4NET User
Subject: Rotated file name control

Greetings!

I am using a rotating file log.  The current file is TrendMasterCS.log.
Yesterday's file is TrendMasterCS.log.2010-07-10.  Since the default
action for a file is based on its extension, I would prefer the rotated
file name to be TrendMasterCS.2010-07-10.log.  I didn't see a way to
control that.  Can it be controlled?

Thank you.

RobR


RE: Rotated file name control

Posted by "Lansdaal, Michael T" <mi...@boeing.com>.
Rob - I use the RollingFileAppender and set the date pattern so that I get a .log extension.

<appender name="RollingDebugLogFileAppender" type="log4net.Appender.RollingFileAppender">
	<file value="TrendMasterCS" />
	<appendToFile value="true" />
	<rollingStyle value="Composite" />
	<staticLogFileName value="false" />
	<datePattern value=".yyyy-MM-dd.lo\g" />

Thanks, Mike 

-----Original Message-----
From: Rob Richardson [mailto:Rob.Richardson@rad-con.com] 
Sent: Wednesday, July 28, 2010 12:57 PM
To: Log4NET User
Subject: Rotated file name control

Greetings!

I am using a rotating file log.  The current file is TrendMasterCS.log.
Yesterday's file is TrendMasterCS.log.2010-07-10.  Since the default action for a file is based on its extension, I would prefer the rotated file name to be TrendMasterCS.2010-07-10.log.  I didn't see a way to control that.  Can it be controlled?

Thank you.

RobR


RE: Rotated file name control

Posted by Radovan Raszka <ra...@hasam.cz>.
Well - but you can wait infinitely ... There is no new release for many years, although many problems were fixed. But to get fixed version, you must take current sources from SVN and compile it yourself (not easy, I wasn't able to compile for CF).

Why new versions are not released? Are there any plans to create new release in the _near_ future? Or we can only download 1.2.10 version forever?

Radovan Raszka

-----Původní zpráva-----
Od: Rob Richardson [mailto:Rob.Richardson@rad-con.com] 
Odesláno: 28. července 2010 22:18
Komu: Log4NET User
Předmět: RE: Rotated file name control

Rob,

Thanks for the information.  It's not a big deal.  I'll just wait for an official version that has that property working.

RobR 

RE: Rotated file name control

Posted by Rob Richardson <Ro...@rad-con.com>.
Rob,

Thanks for the information.  It's not a big deal.  I'll just wait for an
official version that has that property working.

RobR 

RE: Rotated file name control

Posted by Rob Prouse <Ro...@Ivara.com>.
Rob

There is a property PreserveLogFileNameExtension checked into the trunk, but I don't think it is in the shipped version of log4net and there is an issue reported against it, https://issues.apache.org/jira/browse/LOG4NET-203, RollingFileAppender does not roll more than one time when PreserveLogFileNameExtension is true. The original issue that added this feature is at https://issues.apache.org/jira/browse/LOG4NET-64.

To use it, you would add the following line to your appender

<preserveLogFileNameExtension value="true"/>

I have a compiled version of the current source at http://www.alteridem.net/2010/07/09/log4net-udpappender-with-ipv6-on-windows-vista-and-7/ that you can try if this feature is important to you, but I would suggest testing it before you deploy as it is not an official release and likely contains bugs.

Rob

-----Original Message-----
From: Rob Richardson [mailto:Rob.Richardson@rad-con.com] 
Sent: Wednesday, July 28, 2010 3:57 PM
To: Log4NET User
Subject: Rotated file name control

Greetings!

I am using a rotating file log.  The current file is TrendMasterCS.log.
Yesterday's file is TrendMasterCS.log.2010-07-10.  Since the default
action for a file is based on its extension, I would prefer the rotated
file name to be TrendMasterCS.2010-07-10.log.  I didn't see a way to
control that.  Can it be controlled?

Thank you.

RobR