aspose file tools
The moose likes Other Open Source Projects and the fly likes log4j XML reading problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "log4j XML reading problem" Watch "log4j XML reading problem" New topic
Author

log4j XML reading problem

Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 625

As a property file of log4j I have tried to use .xml file. But PropertyConfigurator couldn't able to read it on the contrarary .properties file worked fine.

Is there anything I am missing while using log4j xml file?
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Well, it depends on what your XML file contains, right?

BTW, I am moving this thread to the 'Other Open source products' forum. that's where we discuss the Log4J stuff anyways, so you would be able to get the maximum help in that forum.

- m


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
DW Bolton
Greenhorn

Joined: Jun 29, 2005
Posts: 28
Originally posted by Jignesh Patel:
As a property file of log4j I have tried to use .xml file. But PropertyConfigurator couldn't able to read it on the contrarary .properties file worked fine.


You actually want to use DOMConfigurator when using an XML file for configuring log4j. PropertyConfigurator is only for reading properties files.

DOMConfigurator.configureAndWatch() is a handy method, because you can set an interval to re-check the configuration file, meaning if you want to change log levels, you won't have to restart your container.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: log4j XML reading problem
 
Similar Threads
tutorials on log4j and struts
Java Logging Or Log4J
Need helping configuring Log4j configuration file to mirror current setup
Any body use Log4J with Tomcat?
Log4J Error [INVALID]