You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by og...@yahoo.com on 2004/04/01 01:14:27 UTC
ERR/WARN: DOM element, No appenders found, etc.
Hello,
According to the Short Manual for Log4J, using log4j.configuration
system property to specify the log4j config file location is the way to
go.
When I do that: java -Dlog4j.configuration=./log4j.xml com.example.Foo
I get:
log4j:ERROR DOM element is - not a <log4j:configuration> element.
log4j:WARN No appenders could be found for logger (com.example.Foo).
log4j:WARN Please initialize the log4j system properly.
I checked my log4j.xml, and it starts with:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!-- $Id: log4j.xml,v 1.3 2004/03/30 03:17:52 otis Exp $ -->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
<appender ..........
I am using Log4J 1.2.8 and I see that my log4j-1.2.8.jar has log4j.dtd
in it.
Any idea why I am getting that error and warning above?
Nothing is getting logged.
Thanks,
Otis
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: ERR/WARN: DOM element, No appenders found, etc.
Posted by Sanjay M <ms...@gmail.com>.
Thanks a TON Ian, this worked for me finally! :-)
<haggaic2v7-loguser <at> yahoo.com> writes:
>
> This is a simple mistake I've made many a time before. The value of
> log4j.configuration needs to be a URL. So the following will work:
>
> java -Dlog4j.configuration=file:./log4j.xml
>
> -Ian
I used something like this giving an absolute path...
-Dlog4j.configuration="file:/D:/Projects/conf/log4j.properties"
Cheers,
Sanjay
http://msanjay.weblogs.us
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: ERR/WARN: DOM element, No appenders found, etc.
Posted by og...@yahoo.com.
Hello,
I have tried that, too, without success:
$ ls -al ./log4j.xml
-rwxr-xr-x 1 otis otis 7021 Mar 31 18:00 ./log4j.xml
$ java -Dlog4j.configuration=file:./log4j.xml com.example.Foo
log4j:ERROR DOM element is - not a <log4j:configuration> element.
log4j:WARN No appenders could be found for logger (com.example.Foo).
log4j:WARN Please initialize the log4j system properly.
I have tried file:./ and file:///, and an absolute UNIX path. None of
those worked.
Maybe Log4J is picking up some other config file from some Jar or some
other place? Is there a way to see which config file Log4J is
complaining about?
Thanks,
Otis
--- haggaic2v7-loguser@yahoo.com wrote:
> This is a simple mistake I've made many a time before. The value of
> log4j.configuration needs to be a URL. So the following will work:
>
> java -Dlog4j.configuration=file:./log4j.xml
>
> -Ian
>
> --- ogjunk-log4j@yahoo.com wrote:
> > Hello,
> >
> > According to the Short Manual for Log4J, using log4j.configuration
> > system property to specify the log4j config file location is the
> way
> > to
> > go.
> >
> > When I do that: java -Dlog4j.configuration=./log4j.xml
> > com.example.Foo
> >
> > I get:
> >
> > log4j:ERROR DOM element is - not a <log4j:configuration> element.
> > log4j:WARN No appenders could be found for logger
> (com.example.Foo).
> > log4j:WARN Please initialize the log4j system properly.
> >
> > I checked my log4j.xml, and it starts with:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> >
> > <!-- $Id: log4j.xml,v 1.3 2004/03/30 03:17:52 otis Exp $ -->
> >
> > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
> > debug="false">
> >
> > <appender ..........
> >
> >
> > I am using Log4J 1.2.8 and I see that my log4j-1.2.8.jar has
> > log4j.dtd
> > in it.
> >
> > Any idea why I am getting that error and warning above?
> > Nothing is getting logged.
> >
> > Thanks,
> > Otis
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: ERR/WARN: DOM element, No appenders found, etc.
Posted by ha...@yahoo.com.
This is a simple mistake I've made many a time before. The value of
log4j.configuration needs to be a URL. So the following will work:
java -Dlog4j.configuration=file:./log4j.xml
-Ian
--- ogjunk-log4j@yahoo.com wrote:
> Hello,
>
> According to the Short Manual for Log4J, using log4j.configuration
> system property to specify the log4j config file location is the way
> to
> go.
>
> When I do that: java -Dlog4j.configuration=./log4j.xml
> com.example.Foo
>
> I get:
>
> log4j:ERROR DOM element is - not a <log4j:configuration> element.
> log4j:WARN No appenders could be found for logger (com.example.Foo).
> log4j:WARN Please initialize the log4j system properly.
>
> I checked my log4j.xml, and it starts with:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>
> <!-- $Id: log4j.xml,v 1.3 2004/03/30 03:17:52 otis Exp $ -->
>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
> debug="false">
>
> <appender ..........
>
>
> I am using Log4J 1.2.8 and I see that my log4j-1.2.8.jar has
> log4j.dtd
> in it.
>
> Any idea why I am getting that error and warning above?
> Nothing is getting logged.
>
> Thanks,
> Otis
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org