Bart van Heukelom
Bart van Heukelom

Reputation: 44114

logback.xml (or other resources) not found in Tomcat

I'm developing a web application using Logback as logging framework, and am testing it in Tomcat 6. For some reason, logback.xml does not get read.

Any idea what's going on?

Update: It appears something deeper is going on. These return null:

// in a servlet
getClass().getClassLoader().getResource("/logback.xml");
getClass().getClassLoader().getResource("MyServlet.class");

When I log the classloader, everything appears fine:

22:32:11.221 [http-8080-1] INFO test.MyServlet - WebappClassLoader
  context: /test
  delegate: false
  repositories:
     /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@630f41e9

Upvotes: 1

Views: 1506

Answers (1)

Bart van Heukelom
Bart van Heukelom

Reputation: 44114

It was a Linux permission thing. Some directory lacked read/execute permissions. I accidentally fixed it when I ran into more problems with that.

Upvotes: 1

Related Questions