This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Log4J

 
Amit Agwal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone help me out here.

My requirement is to set up a call back mechanism from the Log4J
framework into my application when the last log file is about to be
created. I basically want to notify that the logs are nearing full via
an email when the last file is just being written.
Is this possible to achieve in the Log4J framework? How would I
approach this.
 
Paul Clapham
Sheriff
Pie
Posts: 20758
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. Writing a subclass of the appender you are using now would be the typical approach. You have not only the API documentation for the appender, but also its actual source code, so that should make it easy for you to figure out what methods to override.
 
Amit Agwal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul. I am looking at the rollOver() method of the RollingFileAppender class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic