Log4J XML Configuration

Because I want my logfiles to have the current date as the filename, I started to convert my Log4J property files to XML files.

After I completed this, I received the error:
log4j:WARN No appenders could be found for logger
Wich means the xml file could not be found.

The problem was this:
PropertyConfigurator.configure("location_of_my_xml_file");

Instead use:
DOMConfigurator.configure("location_of_my_xml_file");

And ofcourse the source:
http://www.javabeat.net/tips/82-baisc-steps-to-configure-log4j-using-xml-and.html

Advertisements
Log4J XML Configuration

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s