[logback-user] logback.xml not working inside Ant task

cowwoc cowwoc at bbs.darktech.org
Thu Aug 28 19:03:16 CEST 2008


		System.out.println("logback1=" +
getClass().getClassLoader().getResource("logback.xml"));
		System.out.println("logback2=" +
Thread.currentThread().getContextClassLoader().getResource("logback.xml"));

gives me this output:

logback1=jar:file:/C:/Users/Gili/Documents/blueeye/trunk/org/jace/release/lib/jace.jar!/logback.xml
logback2=null

Gili


Ceki Gulcu-2 wrote:
> 
> 
> The "/" prefix in "/logback.xml" also looks suspicious...
> 
> Try,
> 
> getClass().getClassLoader().getResource("logback.xml");
> 
> or alternatively
> 
> Thread.currentThread().getContextClassLoader().getResource("logback.xml");
> 
> HTH,
> 
> Thorbjørn Ravn Andersen wrote:
>> cowwoc skrev  den 26-08-2008 11:14:
>>>      getClass().getResourceAsStream("/logback.xml")
>>>
>>>   
>> So the file must be in the classpath.  How do you ensure that it is?
>> 
> 
> -- 
> Ceki Gülcü
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
> 
> 

-- 
View this message in context: http://www.nabble.com/logback.xml-not-working-inside-Ant-task-tp19158480p19204835.html
Sent from the Logback User mailing list archive at Nabble.com.



More information about the Logback-user mailing list