File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Log4j SMTPAppender Not Sending Mail Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Log4j SMTPAppender Not Sending Mail" Watch "Log4j SMTPAppender Not Sending Mail" New topic
Author

Log4j SMTPAppender Not Sending Mail

David McWilliams
Ranch Hand

Joined: Mar 14, 2009
Posts: 73
Hi all,

I have written a small Java program to try to get log4j + SMTPAppender to log an error and send me an email when my program throws an exception. The exception is being correctly logged but no mail is being sent.

I have tested my program to see if it sends mail and it does - just not via log4j. I am using a log4j.properties file to configure the logging.

Have any of you any ideas why my email is not being sent when I throw an exception? Here is my log4j.properties file:
David McWilliams
Ranch Hand

Joined: Mar 14, 2009
Posts: 73
It's working now. In my code, I was calling


I changed it to:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log4j SMTPAppender Not Sending Mail
 
Similar Threads
BEA 7.0 & log4j
Unhandled execption in EXE containing executable jar file.
SMTPAppender problem while E-Mailing log file
Need help with log4j logging tool to log into database
log4j.properties: FileNotFoundException