Log4J Error Message
Hello,
I have this code:
publicstaticfinal String LOGGER_NAME="email_notifier_implementation";
...
emailAppender=new SMTPAppender(new TriggeringEventEvaluator()
{
publicboolean isTriggeringEvent(LoggingEvent loggingEvent)
{returntrue;}
});
logger=Logger.getLogger(LOGGER_NAME);
logger.setLevel(Level.ALL);
logger.addAppender(emailAppender);
...
emailAppender.setSMTPHost(host);
emailAppender.setFrom(from);
emailAppender.setSubject(subject);
emailAppender.setTo(buildEmailRecieversList(to));
logger.log(Level.ALL,message);//message is an argument to the function
When I run it, I get an error:
log4j:ERROR Message object not configured.
Can somebody please explain me why this error is happening and how to fix it?
Thanks.
It's an extremely important skill to learn how to [url=http://www.google.com/]search the web[/url]. Not only will it increase your research and development talents, it will also save you from asking questions that have already been answered numerous times before. By doing a little research before you ask a question, you'll show that you're willing to work and learn without needing to have your hand held the entire time; a quality that is seemingly rare but much appreciated by the volunteers who are willing to help you.
If you've done the research, found nothing useful, and decide to post your question, it's a great idea to tell us that you've already searched (and what methodologies you used to do your research). That way, we don't refer you back to something you've already seen.
For example and to get you started, google "[url=http://www.google.com/search?q=log4j+xml+configuration]log4j xml configuration[/url]". The first couple of links contain the information you need, or point you to the source of such information.
Good luck!