• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems with DailyRollingFileAppender in log4j

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am facing a strange issue using DailyRollingFileAppender of log4j.

I want to append the date to my logfile's name Eg. Sample.log.25_08_2005 , so that i get the logs for all days in seperate files.

For this DailyRollingFileAppender can be used which rolls at the midnight and renames your file with the name appended by the date of the day.

But since my application which uses log4j is a standalone application and not a client server application, so it does not roll back and i get the log file by the name Sample.log itself.

On googling i found for DailyRollingFileAppender to work, your application should be running at midnight ; but in my case this cant happen.

So can anyone tell me how to achieve this using log4j i.e. appending date to the filename.I dont want to code additionaly to attain this.I am sure log4j is robust enough to support this.

Please help me out if incase any guys have faced the same issue.

Thanks in advance,
Saurabh
 
What a show! What atmosphere! What fun! What a tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic