Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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

 
Ranch Hand
Posts: 316
  • 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
  • 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.
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • 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
  • 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
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • 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.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!