Ah, thank you very much.  I didn't expect that to be the case, since
it's not a class.

And congratulations on the new baby!

One final question.  I think this may be more of a Java question than a
log4j question, but indulge me.  Based on the newfound knowledge that
the properties file needs to be in the classpath, I naturally tried
this:

% java  -Dlog4j.debug=true -cp .
-Dlog4j.configuration=mylog4j.properties -jar Proximo-Demo.jar

(and a lot of variations on that)

It appears that when I use the -jar command line option to java, the
classpath defined with -cp is totally ignored.  This is on Linux with
Java 5.  Looking at the man page for java, it doesn't say anything about
-cp and -jar being mutually exclusive.  But they seem to be, because
whenever I use -jar, nothing I specify with -cp is honored.  Am I crazy
or is this true?


Todd.


> -----Original Message-----
> From: Scott Deboy [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, March 22, 2005 2:45 PM
> To: Log4J Users List
> Subject: RE: why does log4j ignore my log4j.properties definition?
> 
> config file must be in classpath.
> 
> typing 1-handed - new baby boy!
> 
> 
> -----Original Message-----
> From: Bradley, Todd [mailto:[EMAIL PROTECTED]
> Sent: Tue 3/22/2005 1:41 PM
> To:   Log4J Users List
> Cc:   
> Subject:      RE: why does log4j ignore my log4j.properties 
> definition?
> Thank you for pointing out my stupid typo.  However, it still doesn't
> work:
> 
> [EMAIL PROTECTED]:~/sample-app-MS1> java  -Dlog4j.debug=true 
> -Dlog4j.configuration=mylog4j.properties -jar Proximo-Demo.jar
> log4j: Trying to find [mylog4j.properties] using context 
> classloader [EMAIL PROTECTED]
> log4j: Trying to find [mylog4j.properties] using
> [EMAIL PROTECTED] class loader.
> log4j: Trying to find [mylog4j.properties] using 
> ClassLoader.getSystemResource().
> log4j: Could not find resource: [mylog4j.properties].
> log4j:WARN No appenders could be found for logger 
> (com.polycom.proximo.alpha.SipUA).
> log4j:WARN Please initialize the log4j system properly.
> 
> I also tried giving it the full path to the 
> mylog4j.properties file, and it still says "Could not find resource".
> 
> 
> Todd.
>  
> 
> > -----Original Message-----
> > From: Scott Deboy [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, March 22, 2005 1:49 PM
> > To: Log4J Users List
> > Subject: RE: why does log4j ignore my log4j.properties definition?
> > 
> > -Dlog4j.configuration=mylog4j.properties
> > 
> > 
> > -----Original Message-----
> > From:       Bradley, Todd [mailto:[EMAIL PROTECTED]
> > Sent:       Tue 3/22/2005 12:48 PM
> > To: Log4J Users List
> > Cc: 
> > Subject:    why does log4j ignore my log4j.properties definition?
> > I'm running a program from a jar file that contains its own 
> > log4j.properties.  However, I want to override that and 
> tell it to use 
> > my own properties file.  However, even though I give java a 
> > -Dlog4j.properties argument, it ignores that and reads in a 
> different 
> > properties file.  See here:
> > 
> > [EMAIL PROTECTED]:~/sample-app-MS1> java  -Dlog4j.debug=true 
> > -Dlog4j.properties=mylog4j.properties -jar Proximo-Demo.jar
> > log4j: Trying to find [log4j.xml] using context classloader 
> > [EMAIL PROTECTED]
> > log4j: Trying to find [log4j.xml] using
> > [EMAIL PROTECTED] class loader.
> > log4j: Trying to find [log4j.xml] using 
> > ClassLoader.getSystemResource().
> > log4j: Trying to find [log4j.properties] using context classloader 
> > [EMAIL PROTECTED]
> > log4j: Using URL
> > [jar:file:/home/tbradley/sample-app-MS1/Proximo-Demo.jar!/log4
> > j.properti
> > es] for automatic log4j configuration.
> > log4j: Reading configuration from URL
> > jar:file:/home/tbradley/sample-app-MS1/Proximo-Demo.jar!/log4j
> > .propertie
> > s
> > log4j: Parsing for [root] with value=[DEBUG,CONSOLE].
> > log4j: Level token is [DEBUG].
> > (and so on)
> > 
> > [EMAIL PROTECTED]:~/sample-app-MS1> ls mylog4j.properties 
> > mylog4j.properties
> > 
> > Why is it looking for and loading log4j.properties from the 
> jar file 
> > instead of the mylog4j.properties file?  This is on Linux 
> with Java 5, 
> > if that matters.  Obviously, log4j is honoring my 
> -Dlog4j.debug=true.
> > So, why not the name of the properties file?
> > 
> > 
> > Todd.
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to