Logback RollingFileAppender not writing to proper file

I’m trying to set up Logback with my Web Application. My logback.xml file looks like below:

<?xml version="1.0" encoding="UTF-8"?>

<configuration scan="true" scanPeriod="60 seconds">
<appender name="tests_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>tests.log</file>
    <append>true</append>

    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
        <fileNamePattern>tests.%i.log.zip</fileNamePattern>
        <minIndex>1</minIndex>
        <maxIndex>10</maxIndex>
    </rollingPolicy>

    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
        <maxFileSize>100MB</maxFileSize>
    </triggeringPolicy>

    <encoder>
        <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
</appender>

<appender name="application_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>application.log</file>
    <append>true</append>

    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
        <fileNamePattern>application.%i.log.zip</fileNamePattern>
        <minIndex>1</minIndex>
        <maxIndex>10</maxIndex>
    </rollingPolicy>

    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
        <maxFileSize>100MB</maxFileSize>
    </triggeringPolicy>

    <encoder>
        <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
</appender>

<logger name="tests" level="DEBUG">
    <appender-ref ref="tests_file" />       
</logger>

<logger name="application" level="INFO">
    <appender-ref ref="application_file" />     
</logger>

</configuration>

This file is placed in WEB-INF/classes.

I have a servlet with the following constructor:

public class FrontController extends HttpServlet {

    private Logger logger;

    public FrontController() {
        // Initialise the logger
        logger = (Logger)LoggerFactory.getLogger("application");
        logger.info("Starting application");
    }
}

When I start up the servlet within Tomcat, nothing gets written to the application.log file that I’ve declared in logback.xml. Is the LoggerFactory just not finding the xml file or is my xml file wrong?

Thanks

Answer

Well, as it turns on, relative paths are bad. So instead of using simple file name in the file entry, i used the line:

<file>${user.dir}/logs/application.log</file>

Now the servlet logging writes to my eclipse installation folder under ../logs/application.log. All is well.