All Downloads are FREE. Search and download functionalities are using the official Maven repository.

assembly.conf.logback.xml Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Tomcat-Slf4j-Logback (https://github.com/tomcat-slf4j-logback/tomcat-slf4j-logback-config/)

    Copyright (c) 2010-2023 Tomcat-Slf4j-Logback.

    All rights reserved. This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available
    at https://www.eclipse.org/legal/epl-v10.html.

    Contributors: Tomcat-Slf4j-Logback Team.

-->
<configuration>

    <property name="max.retention.days" value="60" />

    <appender name="CONSOLE" class="org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %-5level {%thread} [%logger{20}] : %msg%n</pattern>
        </encoder>
    </appender>

    <!-- Alternative using logstash
    <appender name="CONSOLE" class="org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender">
        <encoder class="org.apache.juli.logging.net.logstash.logback.encoder.LogstashEncoder" />
    </appender>
    -->

    <appender name="FILE-CATALINA" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/catalina.log</file>
        <append>true</append>
        <encoder>
            <charset>utf-8</charset>
            <pattern>%d{HH:mm:ss.SSS} %-5level {%thread} [%logger{40}] : %msg%n</pattern>
        </encoder>
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/catalina-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <cleanHistoryOnStart>true</cleanHistoryOnStart>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>

    <!-- Alternative using logstash
    <appender name="FILE-CATALINA" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/catalina.log</file>
        <append>true</append>
        <encoder class="org.apache.juli.logging.net.logstash.logback.encoder.LogstashEncoder" />
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/catalina-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <cleanHistoryOnStart>true</cleanHistoryOnStart>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>
    -->

    <appender name="FILE-LOCALHOST" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/localhost.log</file>
        <append>true</append>
        <encoder>
            <charset>utf-8</charset>
            <pattern>%d{HH:mm:ss.SSS} %logger{0} {%thread} %level : %msg%n</pattern>
        </encoder>
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/localhost-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>

    <!-- Alternative using logstash
    <appender name="FILE-LOCALHOST" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/localhost.log</file>
        <append>true</append>
        <encoder class="org.apache.juli.logging.net.logstash.logback.encoder.LogstashEncoder" />
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/localhost-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>
    -->

    <appender name="FILE-MANAGER" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/manager.log</file>
        <append>true</append>
        <encoder>
            <charset>utf-8</charset>
            <pattern>%d{HH:mm:ss.SSS} %logger{0} {%thread} %level : %msg%n</pattern>
        </encoder>
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/manager-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>

    <!-- Alternative using logstash
    <appender name="FILE-MANAGER" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/manager.log</file>
        <append>true</append>
        <encoder class="org.apache.juli.logging.net.logstash.logback.encoder.LogstashEncoder" />
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/manager-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>
    -->

    <appender name="FILE-HOST-MANAGER" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/host-manager.log</file>
        <append>true</append>
        <encoder>
            <charset>utf-8</charset>
            <pattern>%d{HH:mm:ss.SSS} %logger{0} {%thread} %level : %msg%n</pattern>
        </encoder>
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/host-manager-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>

    <!-- Alternative using logstash
    <appender name="FILE-HOST-MANAGER" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.base}/logs/host-manager.log</file>
        <append>true</append>
        <encoder class="org.apache.juli.logging.net.logstash.logback.encoder.LogstashEncoder" />
        <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${catalina.base}/logs/archive/host-manager-%d{yyyyMMdd}-%i.log.gz</fileNamePattern> 
            <maxHistory>${max.retention.days}</maxHistory>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>
    -->

    <logger name="org.apache.catalina" level="INFO" additivity="false">
        <appender-ref ref="FILE-CATALINA" />
    </logger>

    <logger name="org.apache.catalina.core.ContainerBase.[Catalina]" level="INFO" additivity="false">
        <appender-ref ref="FILE-LOCALHOST" />
    </logger>

    <logger name="org.apache.catalina.core.ContainerBase.[Catalina].[/manager]" level="INFO"
        additivity="false">
        <appender-ref ref="FILE-MANAGER" />
    </logger>

    <logger name="org.apache.catalina.core.ContainerBase.[Catalina].[/host-manager]" level="INFO"
        additivity="false">
        <appender-ref ref="FILE-HOST-MANAGER" />
    </logger>

    <root level="INFO">
        <appender-ref ref="CONSOLE" />
    </root>

</configuration>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy