• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

log4j XML reading problem

 
Ranch Hand
Posts: 686
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
And then the flying monkeys attacked. My only defense was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic