logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus Mueller <k.muel...@intershop.de>
Subject RE: DailyRollingFileAppender Question
Date Tue, 15 Jan 2002 17:48:05 GMT
> I think your problem is in the way you're initializing your
> DailyRollingFileAppender.  The DailyRollingFileAppender (per 
> the JavaDoc)
> constructor takes a layout, filename, and date pattern.  The 
> filename you're
> providing is "d:/is/share/system/log/error-log-".  That is 
> why log4j is
> creating a file named "error-log-".  The date pattern you provide
> "yyyy-MM-dd-HH-mm" rolls over at the top of every minute.  So, the
> DailyRollingFileAppender is working correctly - just not the 
> way you want

Hi,

thanks for the answer. I found the problem and it was not the
initialization.

Problem:
The same log constructor was used by a multi-process (more then one java
process) application server. Each process uses the same file to log the
messages. While process A holds a handle to the log file while process B
tries to roll over the file (rename). The file rename failed because of the
extra handle. This causes the recreation of an empty file with the same file
name.

Further comments:
The creation of a intermediate file (here "error-log-") is hardly to explain
to anyone using a written application. Does anyone know a reason why not
creating a correct filename (i.e. "error-log-2002-01-15-15-45") for logging?
This prevents possible problems with the rename file system operation. I
modified the DailyRollingFileAppander to work this way. Does anyone know the
reason of the actual design or do I need to ask the developers list?

> it.  I don't know what the '.log' is for in your constructor.....?

I want t create log files like "error-log-2002-01-15-15-45.log". Anyone can
associate the ".log" ending with a log file viewer.

Thanks
Klaus

--
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