• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j: How app.log and app.log.1 are written at same time?

 
Samyuktha S Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a web app running on tomcat. I have rolling file appender. I have configured log4j to write logs into say app.log
But I find that at a time app.log and app.log.1 are written at the same time.
I dont understand how this can be possible.
Please help
 
Nam Ha Minh
Ranch Hand
Posts: 502
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the file "app.log" is the current log, others are rolled files.
 
Samyuktha S Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then only app.log should be updated at current point of time. If the file exceeds the max limit size then it rolls over to the next file
But in this case both app.log and app.log.1. are updated at same time. They have logs with the same timestamp inside it

Is it like more than one process is writing log?

Our app is running on a cluster.
 
Paul Clapham
Sheriff
Posts: 21155
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if you have more than one process writing to a file at the same time, strange things can happen.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic