AW: Load a log4j.xml located within a package - how?

2009-02-10 Thread Bender Heri
Maybe there exists indeed a file "C:\Programme\Mozilla 
Firefox\de\xyz\...\log4j.xml" which is found first by the classloader? Then try 
getResources() to get an enumeration of all resources found.
Or try getSystemResource() of the classloader.
Heri

-Ursprüngliche Nachricht-
Von: Linnemann, Gerrit [mailto:linnem...@hesgdv.de] 
Gesendet: Dienstag, 10. Februar 2009 07:31
An: log4j-user@logging.apache.org
Betreff: Load a log4j.xml located within a package - how?

Hallo,
I'm trying to load a separate config file (log4j.xml) within a jar-File. It is 
an applet and I want to load a config file located within a package.
I tried it like this:
URL path2Conf = 
this.getClass().getClassLoader().getResource("de/xyz/log4j/applets/log4j.xml");
DOMConfigurator.configure(path2Conf);

But the java console of the browser says, the DOMConfigurator wants to load the 
XML from
C:\Programme\Mozilla Firefox\de\xyz\...\log4j.xml


The same with:
String path2Conf = System.getProperty("user.dir") + File.separator + 
"de\\hes\\log4j\\applets\\log4j.xml";
DOMConfigurator.configure(path2Conf);


Has anyone an Idea how to load a config file located within a package?


Thanking you in anticipation,
Gerrit


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



AW: Load a log4j.xml located within a package - how?

2009-02-10 Thread Linnemann, Gerrit
Amendment:
The enumeration has one entry -> URL looks like this:
http://abc.de/example/applet.jar!/de/.../log4j.xml




-Ursprüngliche Nachricht-
Von: Bender Heri [mailto:hben...@ergonomics.ch]
Gesendet: Dienstag, 10. Februar 2009 11:06
An: Log4J Users List
Betreff: AW: Load a log4j.xml located within a package - how?

Maybe there exists indeed a file "C:\Programme\Mozilla 
Firefox\de\xyz\...\log4j.xml" which is found first by the classloader? Then try 
getResources() to get an enumeration of all resources found.
Or try getSystemResource() of the classloader.
Heri

-Ursprüngliche Nachricht-
Von: Linnemann, Gerrit [mailto:linnem...@hesgdv.de]
Gesendet: Dienstag, 10. Februar 2009 07:31
An: log4j-user@logging.apache.org
Betreff: Load a log4j.xml located within a package - how?

Hallo,
I'm trying to load a separate config file (log4j.xml) within a jar-File. It is 
an applet and I want to load a config file located within a package.
I tried it like this:
URL path2Conf = 
this.getClass().getClassLoader().getResource("de/xyz/log4j/applets/log4j.xml");
DOMConfigurator.configure(path2Conf);

But the java console of the browser says, the DOMConfigurator wants to load the 
XML from
C:\Programme\Mozilla Firefox\de\xyz\...\log4j.xml


The same with:
String path2Conf = System.getProperty("user.dir") + File.separator + 
"de\\hes\\log4j\\applets\\log4j.xml";
DOMConfigurator.configure(path2Conf);


Has anyone an Idea how to load a config file located within a package?


Thanking you in anticipation,
Gerrit


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



AW: Load a log4j.xml located within a package - how?

2009-02-10 Thread Linnemann, Gerrit
Hallo,
there're no folders ...\de\... within the Firefox-folder!
And the getSystemResource() has the same result than my trials described before.


:-/


-Ursprüngliche Nachricht-
Von: Bender Heri [mailto:hben...@ergonomics.ch]
Gesendet: Dienstag, 10. Februar 2009 11:06
An: Log4J Users List
Betreff: AW: Load a log4j.xml located within a package - how?

Maybe there exists indeed a file "C:\Programme\Mozilla 
Firefox\de\xyz\...\log4j.xml" which is found first by the classloader? Then try 
getResources() to get an enumeration of all resources found.
Or try getSystemResource() of the classloader.
Heri

-Ursprüngliche Nachricht-
Von: Linnemann, Gerrit [mailto:linnem...@hesgdv.de]
Gesendet: Dienstag, 10. Februar 2009 07:31
An: log4j-user@logging.apache.org
Betreff: Load a log4j.xml located within a package - how?

Hallo,
I'm trying to load a separate config file (log4j.xml) within a jar-File. It is 
an applet and I want to load a config file located within a package.
I tried it like this:
URL path2Conf = 
this.getClass().getClassLoader().getResource("de/xyz/log4j/applets/log4j.xml");
DOMConfigurator.configure(path2Conf);

But the java console of the browser says, the DOMConfigurator wants to load the 
XML from
C:\Programme\Mozilla Firefox\de\xyz\...\log4j.xml


The same with:
String path2Conf = System.getProperty("user.dir") + File.separator + 
"de\\hes\\log4j\\applets\\log4j.xml";
DOMConfigurator.configure(path2Conf);


Has anyone an Idea how to load a config file located within a package?


Thanking you in anticipation,
Gerrit


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org