Howdy,
Or you could just add -Dlog4j.debug=true to your java runtime command.  Much simpler ;)

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Christian Hufgard [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, January 27, 2004 5:57 AM
>To: Log4J Users List
>Subject: Re: log4j.properties not read
>
>Hi Ionel,
>
>you could use the following work-around to determine, what your log4j is
>doing - it did help me too :)
>
>public void initializeLog4j(String propertyfileName) {
>      System.out.println("looking for property file with name "+
>propertyfileName);
>      url =
>this.getClass().getClassLoader().getResource(propertyfileName).toString();
>    } catch (Exception e) {
>      System.out.println("Error: Could not find property file with name
>"+propertyfileName+".");
>      throw new RuntimeException("Could not initialize log4j");
>    }
>    System.out.println("found it: "+url);
>    if (url.indexOf(".jar!") == -1) {
>      url = url.substring(url.indexOf(":")+1);
>      System.out.println("using watchdog on url: "+url);
>      PropertyConfigurator.configureAndWatch(url);
>    } else {
>      System.out.println("just configure, no watching. url: "+url);
>      PropertyConfigurator.configure(url);
>    }
>}
>
>This could show you, wether log4j found the properties-file and uses it and
>you misconfigured it, or it cannot even be found on the classpath.
>
>
>Greets
>
>Christian
>
>
>> Hi,
>>
>> I am running an application that uses log4j.
>> I add the nedded log4j jars and the log4j.properties
>> file on its classpath.
>>
>> Unfortunatly, I see none of the declared log files on
>> my folders.
>>
>> I tries to add a
>> -Dlog4j.properties=<path_to_my_properties_file> but it
>> does not help : i am still missing the log files.
>>
>> How to force log4j to use a specific properties file ?
>>
>> If log4j does not complains about a missing properties
>> file, it should have found it. If it has found it, it
>> should have created the declared log files ...
>>
>> I am lost, any help appreciated,
>> thanks,
>>
>> ionel
>>
>> _________________________________________________________________
>> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
>> Yahoo! Mail : http://fr.mail.yahoo.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>--
>+++ GMX - die erste Adresse für Mail, Message, More +++
>Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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

Reply via email to