Configuration in a XML file
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   D_Garcia
Posted On:   Monday, January 20, 2003 01:52 AM

Hi: I am using a configuration file like (and it works): log4j.rootLogger=debug, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (% F:%L) - %m%n But using a XML file like, a get the messages: "log4j:WARN No appenders could be found for logger" and "log4j:WARN Please initialize the log4j system properly" : <?xml version="1.0" encoding="UTF-8"?>    More>>

Hi:

I am using a configuration file like (and it works):



log4j.rootLogger=debug, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%
F:%L) - %m%n



But using a XML file like, a get the messages: "log4j:WARN No appenders could be found for logger" and "log4j:WARN Please initialize the log4j system properly" :



<?xml version="1.0" encoding="UTF-8"?>



























I have not idea where is the error.


Thanks in advance,


David G.

   <<Less

Re: Configuration in a XML file

Posted By:   Karl_Koster  
Posted On:   Thursday, March 6, 2003 10:43 AM

Have you set your log4j.configuration system property to a URL that will find the xml configuration file? Log4j defaults the system property to log4j.properties.

Re: Configuration in a XML file

Posted By:   Anonymous  
Posted On:   Monday, January 20, 2003 02:54 AM

I can´t see any error in that file. Maybe Log4J can´t find the file? I have problems with loading my xml-config-file into my J2EE application server. If I switched to property-file all works fine. I have no idea.


So I can suggest you two solutions:


  1. take the property file

  2. take the XML file and generates (with xsl) the property file (so you have one codebase)

  3. wait for another comment :-)

About | Sitemap | Contact