Logback Could NOT find resource logback.xml Logback Could NOT find resource logback.xml xml xml

Logback Could NOT find resource logback.xml


And I've copied it into the root of several locations in my classpath

logback has a default way of finding the configuration file here is how the documentation goes:

Let us begin by discussing the initialization steps that logback follows to try to configure itself:

  1. Logback tries to find a file called logback.groovy in the classpath.

  2. If no such file is found, logback tries to find a file called logback-test.xml in the classpath.

  3. If no such file is found, it checks for the file logback.xml in the classpath..

  4. If neither file is found, logback configures itself automatically using the BasicConfigurator which will cause logging output to be directed to the console.

so probably in your case it is loading the basic configuration when you are seeing the output in console. You can try specifying the path in class-path or do it programatically like this