0

I want to sent error message as email whenever error occurs.

I know it is possible using configuration file of log4j.I want to sent mail using log4j using properties file for setting the properties instead of a xml file.

1 Answers1

1

You need to use SMTPAppender to send emails using log4j. See a list of properties here on this page:

https://logging.apache.org/log4j/2.x/manual/appenders.html

The following question has a full solution on how to use log4j SMTPAppender.

Using log4j to send email reports via the SMTPAppender

Rob Scully
  • 744
  • 5
  • 10