Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Issue with filename in log4j2 rolling file appender

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following log4j2.xml configuration. I have a time as well as size based triggering policy. Since the size limit (10 MB) is breached first, the log file rolls over and while creating a new file, it appends wrong date to the filename. What I want is:
- Roll over when a file's size reaches 10 MB (total size of all files should not exceed 1500 times 10 MB)
- Roll over every 15 days

The file names should be abc.log, abc__2021-04-09__1.log, abc__2021-04-09__2.log. Basically it should have the current date appended to it.




Kindly let me know where am I wrong in my code. Thanks in advance.
 
Does this tiny ad smell okay to you?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic