| Author |
log4j error - Failed to rename xxxx to xxxx-yyyy-mm-dd
|
Raj Ohadi
Ranch Hand
Joined: Jun 30, 2006
Posts: 314
|
|
I have an EAR project and I only use log4j in its Web project (WAR). It works fine in the beginning but somehow it starts giving me error
Failed to rename "mylog" to "mylog--yyyy-mm-dd", i.e. it does not Roll over. I set the frequency as MIN.
The strange thing is it works fine this whole afternoon but now it starts giving me problem. Yesterday it had the same issue. I restarted my PC and the problem was gone this morning, now the problem reappears. I have to say, this is an application deployed on my local PC so there is no high volume issue, also more importantly, I thoroughly checked and found there is NO other project running log4j to write to that same file !
What could be the problem ??
|
 |
Raj Ohadi
Ranch Hand
Joined: Jun 30, 2006
Posts: 314
|
|
|
I restarted the application server and the problem was gone again. I am sure it will come back again later. This is the same thing that happened since yesterday.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
This is a Windows system where this occurs? If so then unfortunately that's normal behaviour. There's some situation (which one might describe as a bug) where even if you close a file, trying to rename it immediately after that fails because some process (yours) is using it. And log4j does have to rename "x.log" to "x.log-yyyy-mm-dd".
I finally gave up on this kind of rolling appender for Windows servers and went out looking for a different appender implementation which didn't have this problem. I found one too but I don't have the details here.
|
 |
Raj Ohadi
Ranch Hand
Joined: Jun 30, 2006
Posts: 314
|
|
|
it is on wondows. Do you mean there should not be a problem on unix ?
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
I think it's a Windows-specific problem, if that's what you mean.
|
 |
 |
|
|
subject: log4j error - Failed to rename xxxx to xxxx-yyyy-mm-dd
|
|
|