dcsimg
problems with log4j mail .need help ....
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   suresh_reddy
Posted On:   Sunday, December 15, 2002 03:53 PM

Hi , I am tryting to send email from the log4J. I got the following error :"Message Object not configured" any suggestions ? config file is : log4j.appender.M3=org.apache.log4j.net.SMTPAppender log4j.appender.M3.To=suresh.reddy@jnli.com log4j.appender.M3.From=somrthing@email.com log4j.appender.M3.Subject=Error report log4j.appender.M3.SMTPHost=mail.soething.com log4j.appender.M3.BufferSize=5 log4j.appender.M3.layout=org.log4j.PatternLayout log4j.appender.M3.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n source code is : public static Category CAT = org.apache.log4j.Category.getInstance(Log4jEmailTest.class.getName()); pub   More>>

Hi ,
I am tryting to send email from the log4J. I got the following error :"Message Object not configured"
any suggestions ?

config file is :
log4j.appender.M3=org.apache.log4j.net.SMTPAppender
log4j.appender.M3.To=suresh.reddy@jnli.com
log4j.appender.M3.From=somrthing@email.com
log4j.appender.M3.Subject=Error report
log4j.appender.M3.SMTPHost=mail.soething.com
log4j.appender.M3.BufferSize=5
log4j.appender.M3.layout=org.log4j.PatternLayout
log4j.appender.M3.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
source code is :
public static Category CAT =
org.apache.log4j.Category.getInstance(Log4jEmailTest.class.getName());

public static void main(String[] args)
{
PropertyConfigurator.configure("d:/log4j.config");
SMTPAppender emailAppender = new SMTPAppender();
emailAppender.setSMTPHost("mail.something.com");
emailAppender.setTo("me@something.com");
emailAppender.setFrom("you@something.com");
CAT.addAppender(emailAppender);
System.out.println(" CAT --->"+ CAT.toString());
CAT.fatal("Test error, error, test, test, fatal error");
}

   <<Less
About | Sitemap | Contact