logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <thomas.haw...@oocl.com>
Subject RE: Failed to rename log file
Date Tue, 29 Nov 2005 16:49:59 GMT
Umm, perhaps the file name pattern should use backslashes?

	<param name="File"
value="${APP_HOME}\\logs\\event-handler.log"/>

Cheers!
 
Tom Hawker
Home    408-274-4128
Office  408-576-6591
Mobile  408-835-3643

-----Original Message-----
From: Jitendra Kharche [mailto:Jitendra.Kharche@geometricsoftware.com] 
Sent: Tuesday, November 29, 2005 12:05 AM
To: Log4CXX User
Subject: Failed to rename log file

 
Hi,

I am using Log4Cxx on Windows. I always get the following error 

------------------------------------------------------------------------
-----------------------------------
Failed to rename [C:\app-name/logs/event-handler.log] to
[C:\app-name/logs/event-handler.log.2005-11-28].
------------------------------------------------------------------------
-----------------------------------

Due to this error, in order to continue writing log, Log4Cxx overwrites
the old log file. Thus I lose the old log.

I am using DailyRollingFileAppender and my config file is as given below

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "./log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
	<appender name="APP_LOGFILE"
class="org.apache.log4j.DailyRollingFileAppender">
		<errorHandler
class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
		<param name="File"
value="${APP_HOME}/logs/event-handler.log"/>
		<param name="Append" value="true"/>
		<param name="Threshold" value="warn"/>

		<!-- Rollover at midnight each day -->
		<!--<param name="DatePattern" value="yyyy-MM-dd"/> Does
not work-->

		<param name="MaxFileSize" value="25MB" />
		<param name="MaxBackupIndex" value="10" />
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d %-5p
[%c{1}] %m%n"/>
		</layout>
	</appender>

	<root>
		<appender-ref ref="APP_LOGFILE"/>
	</root>
</log4j:configuration>

Regards,
Jitendra



IMPORTANT NOTICE
Email from OOCL is confidential and may be legally privileged.  If it is not intended for
you, please delete it immediately unread.  The internet cannot guarantee that this communication
is free of viruses, interception or interference and anyone who communicates with us by email
is taken to accept the risks in so doing.  Without limitation, OOCL and its affiliates accept
no liability whatsoever and howsoever arising in connection with the use of this email.  Under
no circumstances shall this email constitute a binding agreement to carry or for provision
of carriage services by OOCL, which is subject to the availability of carrier's equipment
and vessels and the terms and conditions of OOCL's standard bill of lading which is also available
at http://www.oocl.com.

Mime
View raw message