You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Shawn Wilson <sh...@atmreports.com> on 2002/08/28 17:04:51 UTC

DailyRollingFileAppender not renaming files

Hi,

I'm using log4j on the Windows platform and many times I notice that
DailyRollingFileAppender is not able to rename the log file. I get this
messages on stderr:

log4j:ERROR Failed to rename [c:/path/to/my/file] to
[c:/path/to/my/file.2002-08-27].

I searched the archives and someone had said it may have something to do
with multiple threads using a single Logger object. This may in fact be what
is causing my problem since I have two threads in one class that are using
the same Logger.

What should I do to prevent this error from occurring? It is important we
keep backups of all our log files!

Thanks,
-shawn

====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: DailyRollingFileAppender not renaming files

Posted by Shawn Wilson <sh...@atmreports.com>.
I know for a fact it happens with log4j-1.2.5. Now, I think I'm using
log4j-1.2.6 now but I'm not certain because even though I stopped the webapp
(it's running under Tomcat) and put the 1.2.6 jar in the /lib folder, the
1.2.5 jar file was locked so I wasn't able to remove it. Now, after starting
the webapp again, they're both locked.

Here's the configuration from my log4j.xml for the DailyRollingFileAppender:

    <appender name="A3_Nyce"
class="org.apache.log4j.DailyRollingFileAppender">
    	<param name="DatePattern" value="'.'yyyy-MM-dd"/>
    	<!--param name="MaxLogs" value="30"/-->
    	<param name="File"
value="e:/WebApps/atmreports/cvsroot/ATMReports/ATMRealtime_NYCE/WEB-INF/log
s/Nyce.log"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%-15d{ISO8601} %-10p (%c) -
%m%n"/>
		</layout>
    </appender>

File permissions are okay... and it seems to work fine for a few days after
first starting up Tomcat, but then for some reason it just stops renaming
the files and overwrites the same file every day.

-shawn

====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================


> -----Original Message-----
> From: Ceki Gulcu [mailto:ceki@qos.ch]
> Sent: Wednesday, August 28, 2002 9:08 AM
> To: Log4J Users List
> Subject: Re: DailyRollingFileAppender not renaming files
>
>
> At 09:04 28.08.2002 -0600, you wrote:
> >Hi,
> >
> >I'm using log4j on the Windows platform and many times I notice that
> >DailyRollingFileAppender is not able to rename the log file. I get this
> >messages on stderr:
> >
> >log4j:ERROR Failed to rename [c:/path/to/my/file] to
> >[c:/path/to/my/file.2002-08-27].
> >
> >I searched the archives and someone had said it may have something to do
> >with multiple threads using a single Logger object. This may in
> fact be what
> >is causing my problem since I have two threads in one class that
> are using
> >the same Logger.
>
> Don't believe everything you read.
>
> >What should I do to prevent this error from occurring? It is important we
> >keep backups of all our log files!
>
> Which version of log4j is this? What is the DatePattern for
> DailyRollingFileAppender? Is the directory c:/path/to/my protected?
>
> >Thanks,
> >-shawn
>
> --
> Ceki
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DailyRollingFileAppender not renaming files

Posted by Ceki Gülcü <ce...@qos.ch>.
At 09:04 28.08.2002 -0600, you wrote:
>Hi,
>
>I'm using log4j on the Windows platform and many times I notice that
>DailyRollingFileAppender is not able to rename the log file. I get this
>messages on stderr:
>
>log4j:ERROR Failed to rename [c:/path/to/my/file] to
>[c:/path/to/my/file.2002-08-27].
>
>I searched the archives and someone had said it may have something to do
>with multiple threads using a single Logger object. This may in fact be what
>is causing my problem since I have two threads in one class that are using
>the same Logger.

Don't believe everything you read.

>What should I do to prevent this error from occurring? It is important we
>keep backups of all our log files!

Which version of log4j is this? What is the DatePattern for 
DailyRollingFileAppender? Is the directory c:/path/to/my protected?

>Thanks,
>-shawn

--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>