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 "William R. Kreamer" <wk...@draper.com> on 2002/10/21 19:53:01 UTC
problem with log4j.properties file
Hello, I've set up a class, call it com.draper.SomeClass.
package com.draper;
import org.log4j.*;
class SomeClass {
private static final Logger logger = Logger.getLogger(SomeClass.class);
private debugMe() {
logger.debug("hello, world");
}
public static void main(String[] args) {
System.out.println(System.getProperty("log4j.configuration");
SomeClass obj = new SomeClass();
}
}
I've set up a log4j.properties file as follows:
*************
log4j.rootCategory=DEBUG, Default, Chainsaw
log4j.appender.Default=org.apache.log4j.FileAppender
log4j.appender.Default.file=/home/wkreamer/server.log
log4j.appender.Default.layout=org.apache.log4j.xml.XMLLayout
log4j.appender.Default.append=false
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=georgia.draper.com
log4j.appender.Chainsaw.port=4445
log4j.appender.Chainsaw.locationInfo=true
log4j.com.draper.SomeClass=DEBUG, Chainsaw
*******
when I run SomeClass.main(), I get the following output:
[wkreamer@georgia wkreamer]
java -Dlog4j.configuration=/home/wkreamer/log4j.properties -classpath
log4j-1.2.7.jar com.draper.SomeClass
/home/wkreamer/log4j.properties
log4j:WARN No appenders could be found for logger (isr.GeoToCellTransform).
log4j:WARN Please initialize the log4j system properly.
Can anyone point out my mistake? Is it in code, or is it in the way I set
up the log4j.properties file?
Thanks a lot,
Bill Kreamer
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: problem with log4j.properties file
Posted by donald larmee <dl...@utopiansoft.com>.
Try setting -Dlog4j.debug=true on the java invocation command line to see
what is going on...
At 01:55 PM 10/21/2002 -0400, William R. Kreamer wrote:
>oops, I actually get the following output:
>
>[wkreamer@georgia wkreamer]
>java -Dlog4j.configuration=/home/wkreamer/log4j.properties -classpath
>log4j-1.2.7.jar com.draper.SomeClass
>/home/wkreamer/log4j.properties
>log4j:WARN No appenders could be found for logger (com.draper.SomeClass).
>log4j:WARN Please initialize the log4j system properly.
>
>
>----- Original Message -----
>From: "William R. Kreamer" <wk...@draper.com>
>To: <lo...@jakarta.apache.org>
>Sent: Monday, October 21, 2002 1:53 PM
>Subject: problem with log4j.properties file
>
>
> > Hello, I've set up a class, call it com.draper.SomeClass.
> >
> > package com.draper;
> >
> > import org.log4j.*;
> >
> > class SomeClass {
> > private static final Logger logger = Logger.getLogger(SomeClass.class);
> >
> > private debugMe() {
> > logger.debug("hello, world");
> > }
> >
> > public static void main(String[] args) {
> > System.out.println(System.getProperty("log4j.configuration");
> > SomeClass obj = new SomeClass();
> > }
> > }
> >
> > I've set up a log4j.properties file as follows:
> >
> > *************
> >
> > log4j.rootCategory=DEBUG, Default, Chainsaw
> >
> > log4j.appender.Default=org.apache.log4j.FileAppender
> > log4j.appender.Default.file=/home/wkreamer/server.log
> > log4j.appender.Default.layout=org.apache.log4j.xml.XMLLayout
> > log4j.appender.Default.append=false
> >
> > log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
> > log4j.appender.Chainsaw.remoteHost=georgia.draper.com
> > log4j.appender.Chainsaw.port=4445
> > log4j.appender.Chainsaw.locationInfo=true
> >
> > log4j.com.draper.SomeClass=DEBUG, Chainsaw
> >
> > *******
> >
> > when I run SomeClass.main(), I get the following output:
> >
> > [wkreamer@georgia wkreamer]
> > java -Dlog4j.configuration=/home/wkreamer/log4j.properties -classpath
> > log4j-1.2.7.jar com.draper.SomeClass
> > /home/wkreamer/log4j.properties
> > log4j:WARN No appenders could be found for logger
>(isr.GeoToCellTransform).
> > log4j:WARN Please initialize the log4j system properly.
> >
> > Can anyone point out my mistake? Is it in code, or is it in the way I set
> > up the log4j.properties file?
> >
> > Thanks a lot,
> > Bill Kreamer
> >
> >
> > --
> > To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
> > For additional commands, e-mail:
><ma...@jakarta.apache.org>
> >
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
donald h. larmee dlarmee@utopiansoft.com
804.301.UTOP
utopian software concepts, inc.
www.utopiansoft.com
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: problem with log4j.properties file
Posted by "William R. Kreamer" <wk...@draper.com>.
Never mind -- the problem was that log4j never found my properties file! It
would be nice if the default output from log4j was a little more
descriptive -- i.e. if it had told me that it didn't find a configuration
file, I would have found the error faster!
Thanks,
Bill
----- Original Message -----
From: "William R. Kreamer" <wk...@draper.com>
To: "Log4J Users List" <lo...@jakarta.apache.org>
Sent: Monday, October 21, 2002 1:55 PM
Subject: Re: problem with log4j.properties file
> oops, I actually get the following output:
>
> [wkreamer@georgia wkreamer]
> java -Dlog4j.configuration=/home/wkreamer/log4j.properties -classpath
> log4j-1.2.7.jar com.draper.SomeClass
> /home/wkreamer/log4j.properties
> log4j:WARN No appenders could be found for logger (com.draper.SomeClass).
> log4j:WARN Please initialize the log4j system properly.
>
>
> ----- Original Message -----
> From: "William R. Kreamer" <wk...@draper.com>
> To: <lo...@jakarta.apache.org>
> Sent: Monday, October 21, 2002 1:53 PM
> Subject: problem with log4j.properties file
>
>
> > Hello, I've set up a class, call it com.draper.SomeClass.
> >
> > package com.draper;
> >
> > import org.log4j.*;
> >
> > class SomeClass {
> > private static final Logger logger =
Logger.getLogger(SomeClass.class);
> >
> > private debugMe() {
> > logger.debug("hello, world");
> > }
> >
> > public static void main(String[] args) {
> > System.out.println(System.getProperty("log4j.configuration");
> > SomeClass obj = new SomeClass();
> > }
> > }
> >
> > I've set up a log4j.properties file as follows:
> >
> > *************
> >
> > log4j.rootCategory=DEBUG, Default, Chainsaw
> >
> > log4j.appender.Default=org.apache.log4j.FileAppender
> > log4j.appender.Default.file=/home/wkreamer/server.log
> > log4j.appender.Default.layout=org.apache.log4j.xml.XMLLayout
> > log4j.appender.Default.append=false
> >
> > log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
> > log4j.appender.Chainsaw.remoteHost=georgia.draper.com
> > log4j.appender.Chainsaw.port=4445
> > log4j.appender.Chainsaw.locationInfo=true
> >
> > log4j.com.draper.SomeClass=DEBUG, Chainsaw
> >
> > *******
> >
> > when I run SomeClass.main(), I get the following output:
> >
> > [wkreamer@georgia wkreamer]
> > java -Dlog4j.configuration=/home/wkreamer/log4j.properties -classpath
> > log4j-1.2.7.jar com.draper.SomeClass
> > /home/wkreamer/log4j.properties
> > log4j:WARN No appenders could be found for logger
> (isr.GeoToCellTransform).
> > log4j:WARN Please initialize the log4j system properly.
> >
> > Can anyone point out my mistake? Is it in code, or is it in the way I
set
> > up the log4j.properties file?
> >
> > Thanks a lot,
> > Bill Kreamer
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: problem with log4j.properties file
Posted by "William R. Kreamer" <wk...@draper.com>.
oops, I actually get the following output:
[wkreamer@georgia wkreamer]
java -Dlog4j.configuration=/home/wkreamer/log4j.properties -classpath
log4j-1.2.7.jar com.draper.SomeClass
/home/wkreamer/log4j.properties
log4j:WARN No appenders could be found for logger (com.draper.SomeClass).
log4j:WARN Please initialize the log4j system properly.
----- Original Message -----
From: "William R. Kreamer" <wk...@draper.com>
To: <lo...@jakarta.apache.org>
Sent: Monday, October 21, 2002 1:53 PM
Subject: problem with log4j.properties file
> Hello, I've set up a class, call it com.draper.SomeClass.
>
> package com.draper;
>
> import org.log4j.*;
>
> class SomeClass {
> private static final Logger logger = Logger.getLogger(SomeClass.class);
>
> private debugMe() {
> logger.debug("hello, world");
> }
>
> public static void main(String[] args) {
> System.out.println(System.getProperty("log4j.configuration");
> SomeClass obj = new SomeClass();
> }
> }
>
> I've set up a log4j.properties file as follows:
>
> *************
>
> log4j.rootCategory=DEBUG, Default, Chainsaw
>
> log4j.appender.Default=org.apache.log4j.FileAppender
> log4j.appender.Default.file=/home/wkreamer/server.log
> log4j.appender.Default.layout=org.apache.log4j.xml.XMLLayout
> log4j.appender.Default.append=false
>
> log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
> log4j.appender.Chainsaw.remoteHost=georgia.draper.com
> log4j.appender.Chainsaw.port=4445
> log4j.appender.Chainsaw.locationInfo=true
>
> log4j.com.draper.SomeClass=DEBUG, Chainsaw
>
> *******
>
> when I run SomeClass.main(), I get the following output:
>
> [wkreamer@georgia wkreamer]
> java -Dlog4j.configuration=/home/wkreamer/log4j.properties -classpath
> log4j-1.2.7.jar com.draper.SomeClass
> /home/wkreamer/log4j.properties
> log4j:WARN No appenders could be found for logger
(isr.GeoToCellTransform).
> log4j:WARN Please initialize the log4j system properly.
>
> Can anyone point out my mistake? Is it in code, or is it in the way I set
> up the log4j.properties file?
>
> Thanks a lot,
> Bill Kreamer
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>