This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Open Source Projects and the fly likes Log4j - Problem in using SMTPAppender with gmail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4j - Problem in using SMTPAppender with gmail" Watch "Log4j - Problem in using SMTPAppender with gmail" New topic
Author

Log4j - Problem in using SMTPAppender with gmail

Khp Virajith
Ranch Hand

Joined: May 01, 2006
Posts: 85
Hello,

I'm using Log4j as the logging framework and I've configured it to send an email with log information when a log with ERROR/FATAL logging level is created.My Log4j configuration is as follows.




But whenever a log with ERROR/FATAL logging level is created, Log4j tries to send the email but terminates it with the following exception..



Can anybody point out where the problem is?

Thanks in advance!


SCJP, SCWCD, SCMAD, SCSNI
Sirish Kumar Gongal Reddy
Ranch Hand

Joined: Oct 25, 2004
Posts: 109
Hi there,

Check your antivirus settings. Generally antivirus won't allow to send emails using some other program (log4j). Go to properties of antivirus in your system try and check there you must find one option related to email sending just check or uncheck (if it is checked) it will work fine.

I have implement the same thing but I have used log4j.properties not .xml check this out any way...
http://sirishg.blogspot.com/2008/08/error-reporting-through-e-mail-using.html

-Sirish
[ September 19, 2008: Message edited by: Sirish Kumar Gongal Reddy ]
Khp Virajith
Ranch Hand

Joined: May 01, 2006
Posts: 85
Hi Sirish,

Thank you for your reply. But the fact you pointed out is not the issue with my application .Because, my application has email sending functionalities in Reporting Module and they work fine without any error. Therefore that error isn't just because of the Antivirus settings.

I did a deep google search on this and tried to find whether there's any XML configuration tag that I've missed but couldn't find any missing item yet.

My concern is about the 1st line of the error message.which is,



What is "STARTTLS" and how to issue that command from Log4j Configuration?

Any Help from the experts?

Regards,
VIRAJ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Log4j - Problem in using SMTPAppender with gmail