File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j error - Failed to rename xxxx to xxxx-yyyy-mm-dd

 
Raj Ohadi
Ranch Hand
Posts: 316
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 316
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 316
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is on wondows. Do you mean there should not be a problem on unix ?
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's a Windows-specific problem, if that's what you mean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic