Forward c3po log into file at Logback
<p>c3po logs are printed console usually. I tried to forwaRD C3PO LOGS into a file, but does not make it possible</p>

<p>here is my logback.xml and pom.xml</p>

<p><strong>LOGBACK</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;configuration scanPeriod="10 seconds" debug="false" scan="true"&gt;
    &lt;property name="LOG_DIR" value="logs" /&gt;
    &lt;appender name="STDOUTAppender" class="ch.qos.logback.core.ConsoleAppender"&gt;
        &lt;encoder&gt;
            &lt;pattern&gt;%date %level [%X{traceid}] - %C{1}:%L %msg%n&lt;/pattern&gt;
        &lt;/encoder&gt;
    &lt;/appender&gt;


    &lt;appender name="SPRING"
        class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
        &lt;File&gt;${LOG_DIR}/spring.log&lt;/File&gt;
        &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
            &lt;FileNamePattern&gt;${LOG_DIR}/spring.log.%d{yyyy-MM-dd-HH}
            &lt;/FileNamePattern&gt;

            &lt;MaxHistory&gt;30&lt;/MaxHistory&gt;
        &lt;/rollingPolicy&gt;

        &lt;encoder&gt;
            &lt;pattern&gt;%date %level [%X{traceid}] - %C{1}:%L %msg%n&lt;/pattern&gt;
        &lt;/encoder&gt;
    &lt;/appender&gt;

    &lt;appender name="errorAppender"
        class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
        &lt;File&gt;${LOG_DIR}/error/ERROR.log&lt;/File&gt;
        &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
            &lt;FileNamePattern&gt;${LOG_DIR}/error/ERROR.log.%d{yyyy-MM-dd-HH}
            &lt;/FileNamePattern&gt;

            &lt;MaxHistory&gt;72&lt;/MaxHistory&gt;
        &lt;/rollingPolicy&gt;

        &lt;encoder&gt;
            &lt;pattern&gt;%date %level [%thread] %msg%n&lt;/pattern&gt;
        &lt;/encoder&gt;

        &lt;filter class="ch.qos.logback.classic.filter.LevelFilter"&gt;
            &lt;level&gt;ERROR&lt;/level&gt;
            &lt;onMatch&gt;ACCEPT&lt;/onMatch&gt;
            &lt;onMismatch&gt;DENY&lt;/onMismatch&gt;
        &lt;/filter&gt;
    &lt;/appender&gt;

    &lt;appender name="AppAppender"
        class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
        &lt;File&gt;${LOG_DIR}/application/APPLICATION.log&lt;/File&gt;
        &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
            &lt;FileNamePattern&gt;${LOG_DIR}/application/APPLICATION.log.%d{yyyy-MM-dd-HH}
            &lt;/FileNamePattern&gt;
        &lt;/rollingPolicy&gt;

        &lt;encoder&gt;
            &lt;pattern&gt;%date %level [%X{traceid}] - %C{1}:%L %msg%n&lt;/pattern&gt;
        &lt;/encoder&gt;
    &lt;/appender&gt;

    &lt;appender name="TxnAppender"
        class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
        &lt;File&gt;${LOG_DIR}/txn/TXN.log&lt;/File&gt;
        &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
            &lt;FileNamePattern&gt;${LOG_DIR}/txn/TXN.log.%d{yyyy-MM-dd-HH}
            &lt;/FileNamePattern&gt;
        &lt;/rollingPolicy&gt;

        &lt;encoder&gt;
            &lt;pattern&gt;%msg%n&lt;/pattern&gt;
        &lt;/encoder&gt;
    &lt;/appender&gt;

    &lt;appender name="AlarmAppender"
        class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
        &lt;File&gt;${LOG_DIR}/alarm/ALARM.log&lt;/File&gt;
        &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
            &lt;FileNamePattern&gt;${LOG_DIR}/alarm/ALARM.log.%d{yyyy-MM-dd}
            &lt;/FileNamePattern&gt;
        &lt;/rollingPolicy&gt;

        &lt;encoder&gt;
            &lt;pattern&gt;%msg%n&lt;/pattern&gt;
        &lt;/encoder&gt;
    &lt;/appender&gt;

    &lt;appender name="C3POAppender"
        class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
        &lt;File&gt;${LOG_DIR}/c3po/c3po.log&lt;/File&gt;
        &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
            &lt;FileNamePattern&gt;${LOG_DIR}/c3po/c3po.log.%d{yyyy-MM-dd}
            &lt;/FileNamePattern&gt;

            &lt;MaxHistory&gt;30&lt;/MaxHistory&gt;
        &lt;/rollingPolicy&gt;

        &lt;encoder&gt;
            &lt;pattern&gt;%msg%n&lt;/pattern&gt;
        &lt;/encoder&gt;
    &lt;/appender&gt;

    &lt;logger name="org.springframework"&gt;
        &lt;level value="INFO" /&gt;
        &lt;appender-ref ref="SPRING" /&gt;
    &lt;/logger&gt;

    &lt;logger name="TxnLogger"&gt;
        &lt;level value="INFO" /&gt;
        &lt;appender-ref ref="TxnAppender" /&gt;
    &lt;/logger&gt;

    &lt;logger name="AlarmLogger"&gt;
        &lt;level value="INFO" /&gt;
        &lt;appender-ref ref="AlarmAppender" /&gt;
    &lt;/logger&gt;

    &lt;logger name="com.mchange.v2.c3p0"&gt;
        &lt;appender-ref ref="C3POAppender" /&gt;
    &lt;/logger&gt;

    &lt;logger name="com.ttech.pnsender" additivity="true" level="DEBUG"&gt;
        &lt;appender-ref ref="AppAppender" /&gt;
        &lt;appender-ref ref="errorAppender" /&gt;
    &lt;/logger&gt;

    &lt;root level="ERROR"&gt;
        &lt;appender-ref ref="STDOUTAppender" /&gt;
    &lt;/root&gt;
&lt;/configuration&gt;
</code></pre>

<p><strong>POM.XML</strong></p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

&lt;groupId&gt;com.ahmetk&lt;/groupId&gt;
&lt;artifactId&gt;pnsender&lt;/artifactId&gt;


&lt;properties&gt;
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;java.version&gt;1.8&lt;/java.version&gt;
    &lt;docker.image.prefix&gt;springio&lt;/docker.image.prefix&gt;
&lt;/properties&gt;

&lt;parent&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
    &lt;version&gt;1.4.2.RELEASE&lt;/version&gt;
&lt;/parent&gt;

&lt;build&gt;

    &lt;plugins&gt;

        &lt;plugin&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
        &lt;/plugin&gt;




    &lt;/plugins&gt;



&lt;/build&gt;

&lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;redis.clients&lt;/groupId&gt;
        &lt;artifactId&gt;jedis&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot&lt;/artifactId&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-autoconfigure&lt;/artifactId&gt;
    &lt;/dependency&gt;

    &lt;!-- weblogic üzerine deploy etmek için websocket collision olmasin. --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
        &lt;exclusions&gt;
            &lt;exclusion&gt;
                &lt;groupId&gt;org.apache.tomcat.embed&lt;/groupId&gt;
                &lt;artifactId&gt;tomcat-embed-websocket&lt;/artifactId&gt;
            &lt;/exclusion&gt;
        &lt;/exclusions&gt;
    &lt;/dependency&gt;
</code></pre>


            org.apache.tomcat.embed
            tomcat-embed-websocket
            provided
         -->

<pre><code>&lt;!-- to ensure that the embedded servlet container doesn’t interfere with the servlet container --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;


    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
        &lt;artifactId&gt;javax.ws.rs-api&lt;/artifactId&gt;
        &lt;version&gt;2.0.1&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.mockito&lt;/groupId&gt;
        &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
        &lt;version&gt;1.9.5&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.oracle&lt;/groupId&gt;
        &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
        &lt;version&gt;11.2.0.4&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;com.mchange&lt;/groupId&gt;
        &lt;artifactId&gt;c3p0&lt;/artifactId&gt;
        &lt;version&gt;0.9.2.1&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.googlecode.libphonenumber&lt;/groupId&gt;
        &lt;artifactId&gt;libphonenumber&lt;/artifactId&gt;
        &lt;version&gt;7.2.6&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
        &lt;artifactId&gt;gson&lt;/artifactId&gt;
        &lt;version&gt;2.4&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
        &lt;artifactId&gt;guava&lt;/artifactId&gt;
        &lt;version&gt;19.0&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.datastax.cassandra&lt;/groupId&gt;
        &lt;artifactId&gt;cassandra-driver-core&lt;/artifactId&gt;
        &lt;version&gt;3.1.0&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.datastax.cassandra&lt;/groupId&gt;
        &lt;artifactId&gt;cassandra-driver-mapping&lt;/artifactId&gt;
        &lt;version&gt;3.1.0&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
        &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
        &lt;version&gt;1.1.1&lt;/version&gt;
    &lt;/dependency&gt;


    &lt;!-- Push Notification API for IOS devices --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;com.notnoop.apns&lt;/groupId&gt;
        &lt;artifactId&gt;apns&lt;/artifactId&gt;
        &lt;version&gt;1.0.0.Beta7_2-SNAPSHOT&lt;/version&gt;
        &lt;exclusions&gt;
            &lt;exclusion&gt;
                &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
                &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
            &lt;/exclusion&gt;
        &lt;/exclusions&gt;
    &lt;/dependency&gt;


    &lt;dependency&gt;
        &lt;groupId&gt;com.relayrides&lt;/groupId&gt;
        &lt;artifactId&gt;pushy&lt;/artifactId&gt;
        &lt;version&gt;0.5-SNAPSHOT&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;!-- KAFKA-QUEUE --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.kafka&lt;/groupId&gt;
        &lt;artifactId&gt;kafka_2.10&lt;/artifactId&gt;
        &lt;version&gt;0.8.2.1&lt;/version&gt;
            &lt;exclusions&gt;
            &lt;exclusion&gt;
                &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
            &lt;/exclusion&gt;
        &lt;/exclusions&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.kafka&lt;/groupId&gt;
        &lt;artifactId&gt;kafka-clients&lt;/artifactId&gt;
        &lt;version&gt;0.8.2.1&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.avro&lt;/groupId&gt;
        &lt;artifactId&gt;avro&lt;/artifactId&gt;
        &lt;version&gt;1.7.7&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
    &lt;/dependency&gt;

&lt;!--weblogic deployment 3.2.1 ile çalıştı  --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.jboss.logging&lt;/groupId&gt;
    &lt;artifactId&gt;jboss-logging&lt;/artifactId&gt;
    &lt;version&gt;3.3.0.Final&lt;/version&gt;
&lt;/dependency&gt;

    &lt;!-- TESTING- EMBEDEED DB --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;hsqldb&lt;/groupId&gt;
        &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
        &lt;version&gt;1.8.0.10&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;

&lt;/dependencies&gt;
</code></pre>

<p></p>