logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: RollingFileAppender does not roll
Date Sun, 14 Aug 2005 19:14:27 GMT
Alain,

This issue has been fixed in CVS. The issue tracking this is:
http://issues.apache.org/jira/browse/LOG4NET-41

Cheers,
Nicko 

> -----Original Message-----
> From: Alain ABENHAIM [mailto:alain.abenhaim@free.fr] 
> Sent: 23 July 2005 23:48
> To: log4net-user@logging.apache.org
> Subject: RollingFileAppender does not roll
> 
> Hi,
> 
> I have a problem with the RollingFileAppender (Date type): 
> the rolled files are not created.
> 
> * Application Type : ASP.NET
> 
> * Logging directory : <Application Root Directory>\Log\
> 
> * My config file (interesting section) :
> 	<appender name="FileCompleteLog"
> type="log4net.Appender.RollingFileAppender">
> 		<file value="Log\ProsperApp.log" />
> 		<appendToFile value="true" />
> 		<rollingStyle value="Date" />
> 		<datePattern value="yyyyMMdd-HHmm" />
> 		<maxSizeRollBackups value="30" />
> 		<staticLogFileName value="true" />
> 		<layout type="log4net.Layout.PatternLayout">
> 			<conversionPattern value="%d{dd-MM-yyyy
> HH:mm:ss,fff}	[%-5t]	%-5p	%-25logger	[%-17.17M]	*%-8u*
> %m%n"/>
> 		</layout>
> 		<filter type="log4net.Filter.LevelRangeFilter">
> 			<levelMin value="DEBUG" />
> 			<levelMax value="FATAL" />
> 		</filter>
> 	</appender>
> 
> * Here is the Log4Net internal log :
> 	- When the application starts (extracts) :
> ...
> log4net: RollingFileAppender: curSizeRollBackups starts at [0]
> log4net: RollingFileAppender: [20050802-1412] vs. [20050802-1415]
> log4net: RollingFileAppender: Initial roll over to 
> [d:\inetpub\wwwroot\ProsperApp\Log\ProsperApp.log20050802-1412]
> log4net:WARN RollingFileAppender: Cannot RollFile 
> [Log\ProsperApp.log] -> 
> [d:\inetpub\wwwroot\ProsperApp\Log\ProsperApp.log20050802-1412
> ]. Source does not exist
> log4net: RollingFileAppender: curSizeRollBackups after rollOver at [0]
> log4net: FileAppender: Opening file for writing 
> [d:\inetpub\wwwroot\ProsperApp\Log\ProsperApp.log] append [True] ...
> 
> 	- When the date have changed and the log needs to be rolled :
> log4net: RollingFileAppender: Moving
> [d:\inetpub\wwwroot\ProsperApp\Log\ProsperApp.log] -> 
> [Log\ProsperApp.log20050802-1415] log4net:ERROR 
> [RollingFileAppender] Exception while rolling file 
> [d:\inetpub\wwwroot\ProsperApp\Log\ProsperApp.log] -> 
> [Log\ProsperApp.log20050802-1415]
> System.IO.DirectoryNotFoundException: Impossible de trouver 
> une partie du chemin d'accès "Log\ProsperApp.log20050802-1415".
>    at System.IO.__Error.WinIOError(Int32 errorCode, String str)
>    at System.IO.File.Move(String sourceFileName, String destFileName)
>    at log4net.Appender.RollingFileAppender.RollFile(String 
> fromFile, String
> toFile) in
> c:\Work\cvs_root\apache\r1.2.9\logging-log4net\build\package\l
> og4net-1.2.9-b
> eta\src\Appender\RollingFileAppender.cs:line 1062 log4net:ERROR
> RollingFileAppender: INTERNAL ERROR. Append is False but 
> OutputFile [d:\inetpub\wwwroot\ProsperApp\Log\ProsperApp.log] 
> already exists.
> log4net: FileAppender: Opening file for writing 
> [d:\inetpub\wwwroot\ProsperApp\Log\ProsperApp.log] append [False]
> 
> * Isn't there a bug in the RollingFileAppender.cs, RollFile 
> method? The following line
> 	System.IO.File.Move(fromFile, toFile);
> Should be replaced by :
> 	System.IO.File.Move(fromFile, ConvertToFullPath(toFile));
> 
> A way I found for resolving the problem without modifying the 
> code is putting the full path in the config file :
> 	<file 
> value="D:\Inetpub\wwwroot\ProsperApp\Log\ProsperApp.log" />
> 
> Thanks up front.
> 
> AlainA
> 
> 
> 
> 
> 
> 

Mime
View raw message