File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Help with Log4J Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Help with Log4J" Watch "Help with Log4J" New topic
Author

Help with Log4J

Amit Agwal
Greenhorn

Joined: Apr 06, 2006
Posts: 10
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.


I live on Java. Sometimes I eat food.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Apr 06, 2006
Posts: 10
Thanks Paul. I am looking at the rollOver() method of the RollingFileAppender class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with Log4J