Error Reporting through E-Mail using Log4j (SMTPAppender Class)
This could be one of the cool thing if you get an intimation through an email when ever your application is facing the problem in production or test environments apart from this you get log file as well so we can decrees the turn around time some what in fixing and issue and making your environment up. A few months back I have implemented the same thing for one of our production application and I have used log4j for logging and emailing the log file when ever log file get populated with error level messages. In log4j api we have one class called SMTPAppender which will email us our log file when ever log file is populated with error level message. Just needs to configure log4j properties file with all SMTP server details. Note: Make sure that you should have mail.jar and activation.jar files in your class path. log4j.properties: log4j.rootLogger=INFO, filer ,SMTPTest log4j.appender.filer=org.apache.log4j.RollingFileAppender log4j.appender.filer.layout=org.apache.log4j.PatternLayout lo...