Or you can use

         <class>.getClassLoader().getResource(<file>)

(e.g., this.getClass().getClassLoader().getResource("log4j.xml")

which returns the URL of this file on the classpath.

At 09:44 01/03/2001 -0500, Jim Moore wrote:
>You have to provide what file to use as a system property. For example:
>
>java -Dlog4j.configuration=file:log4j.xml MyProgram
>
>-Jim Moore
>
>
>-----Original Message-----
>From: Rouwendaal, Fernand [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, March 01, 2001 3:17 AM
>To: '[EMAIL PROTECTED]'
>Subject: Difference in using BasicConfigurator v.s. DOMCOnfigurator
>
>
>Hi,
>
>When using the BasicConfigurator, you can make use of a very handy feature:
>The configuration file log4j.properties is searched for in the classpath.
>Benefit: In your code, you never have to specify the location hardcoded.
>
>When using the DOMConfigurator, I cannot make this mechanism to work. Am I
>doing something wrong, or is this feature unsupported for DOMConfigurators ?
>
>         - Fernand.
>
>
>---------------------------------------------------------------------
>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]

-- 
Fergus Gallagher
Orbis
http://www.orbisuk.com/
+44-(0)20-8987 0717


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

Reply via email to