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]

Reply via email to