Additional log files other than App.Log

I’ve been looking into the logging of the application and it appears everything goes into the App.log file. We are using Apache Camel inside of Cuba for integration purposes and we were hoping that we could have a separate log file related just to integration to help separate concerns. Is there a way that I can specify a different log file for different sources? Thanks.

The platform uses logback library as a backend of slf4j logging library. You can customize tomcat/conf/logback.xml file in your local deployment or in a production environment using the following JVM argument (it should be set in tomcat script or in CATALINA_OPTS):


In this file you can split your loggers by multiple files using logback appender-ref parameter. For instance, we could move com.haulmont.cuba logs to a separate file cuba-platform.log using this appender and logger settings:

    <appender name="PLATFORM-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">

        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- daily rollover -->
            <!-- keep 30 days' worth of history -->

            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level &#91;%thread%X{cubaApp}%X{cubaUser}&#93; %logger - %msg%n</pattern>


    <!-- additivity=false ensures logs only goes to the cuba-platform log -->
    <logger name="com.haulmont.cuba" level="DEBUG" additivity="false">
        <appender-ref ref="PLATFORM-FILE"/> <!-- Log CUBA to separate file -->

logback.xml (5.6K)