logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject RE: Error in renaming the file During DailyRollover option
Date Tue, 10 Dec 2002 15:21:11 GMT

Is the previous run of your servlet closed and unloaded when you run the 
new version? What happens if you change the DatePattern to 
.yyyy-MM-dd-HH-mm (minutely rollover)? Do rollovers occur?

At 20:43 10.12.2002 +0530, Shailesh Vaidya wrote:
>I am using WebSphere Application Developer Test Engine. The Config file
>details are as follows. I am using the default config file log4j.properties
>and it is kept in web-inf\classes directly. The messages are properly
>logged. Just that file remains open even when the doGet method is over. When
>I try to run the servlet the next day ( by changing the system date and
>time) I get the message "log4j:ERROR Failed to rename [d:\ajit\example] to
>[d:\ajit\example.2002-12-18]."
>
>********************************
>log4j.rootCategory=WARN,R
>log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
>log4j.appender.R.File=d:\\ajit\\example
>log4j.appender.R.layout=org.apache.log4j.PatternLayout
>log4j.appender.R.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
>log4j.appender.R.DatePattern='.'yyyy-MM-dd
>***********************
>
>
>Shailesh
>
>-----Original Message-----
>From: Ceki Gulcu [mailto:ceki@qos.ch]
>Sent: Tuesday, December 10, 2002 8:24 PM
>To: Log4J Users List
>Subject: Re: Error in renaming the file During DailyRollover option
>
>
>
>Which server engine is this? What is your config file?
>
>At 00:19 19.12.2002 +0530, Shailesh Vaidya wrote:
>
> >Hi,
> >
> >I am trying to use DailyRollingFileAppender. When the  logger tries to
> >rollover and rename the file we get a error message
> >
> >Can not rename the file exaple.log to example.log.mm-dd-yyyy". The reason
>is
> >the file remains open. I am logging in a servlet
> >
> >the code is
> >
> >import java.io.*;
> >import org.apache.log4j.*;
> >import javax.servlet.http.HttpServlet;
> >
> >public class LoggingServlet extends HttpServlet {
> >
> >
> >         public void doGet(
> >             javax.servlet.http.HttpServletRequest request,
> >                 javax.servlet.http.HttpServletResponse response)
> >                 throws javax.servlet.ServletException, java.io.IOException
>{
> >           Logger log = Logger.getLogger("log1");
> >           log.debug("Start of main()");
> >         log.info("Just testing a log message with priority set to INFO");
> >         log.warn("Just testing a log message with priority set to WARN");
> >         log.error("Just testing12 a log message with priority set to
> >ERROR");
> >         log.fatal("Just testing a log message with priority set to
>FATAL");
> >
> >    }
> >}
> >
> >Actually the error occurs because the file is locked by the servlet engine
> >even when the doGet method finishes. The lock gets released only when I
>stop
> >the servlet engine.
> >
> >How could we rectify this error so that rollover happens properly.
> >
> >Thanks in advance for any help.
> >
> >
> >Shailesh
> >
> >
> >--
> >To unsubscribe, e-mail:
><mailto:log4j-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
><mailto:log4j-user-help@jakarta.apache.org>
>
>--
>Ceki
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

--
Ceki



--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message