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

pom.agent.2.10.47.7.source-code.logback.xml Maven / Gradle / Ivy

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

    The MIT License (MIT)

    Copyright (c) 2019 Code Technology Studio

    Permission is hereby granted, free of charge, to any person obtaining a copy of
    this software and associated documentation files (the "Software"), to deal in
    the Software without restriction, including without limitation the rights to
    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
    the Software, and to permit persons to whom the Software is furnished to do so,
    subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-->
<configuration scan="true" scanPeriod=" 5 seconds">

    <!--动态定义日志路径,请勿修改将影响查看系统日志功能-->
    <define name="logPath" class="org.dromara.jpom.system.AgentLogbackConfig"/>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{10} [%file:%line] - %msg%n</pattern>
            <!--            <pattern><![CDATA[%date %level [%thread] %logger{10} [%file:%line]- x:\(%X\) %msg %n]]></pattern>-->
        </encoder>
    </appender>

    <appender name="LOG-ROOT" class="ch.qos.logback.classic.sift.SiftingAppender">
        <discriminator>
            <Key>destination</Key>
            <DefaultValue>agent</DefaultValue>
        </discriminator>
        <sift>
            <appender name="FILE-${destination}" class="ch.qos.logback.core.rolling.RollingFileAppender">
                <File>${logPath}/${destination}.log</File>
                <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                    <!-- rollover daily -->
                    <fileNamePattern>${logPath}/%d{yyyy-MM-dd}/${destination}-%d{yyyy-MM-dd}-%i.log</fileNamePattern>
                    <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                        <!-- or whenever the file size reaches 100MB -->
                        <maxFileSize>512MB</maxFileSize>
                    </timeBasedFileNamingAndTriggeringPolicy>
                    <maxHistory>60</maxHistory>
                </rollingPolicy>
                <encoder>
                    <pattern>
                        %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{10} [%file:%line] - %msg%n
                    </pattern>
                </encoder>
            </appender>
        </sift>
    </appender>


    <root level="info">
        <appender-ref ref="LOG-ROOT"/>
        <appender-ref ref="STDOUT"/>
    </root>

    <logger name="org.springframework.web.servlet.DispatcherServlet" additivity="false">
        <!--  打印请求信息-->
        <level value="debug"/>
        <appender-ref ref="LOG-ROOT"/>
        <appender-ref ref="STDOUT"/>
    </logger>

    <!--请求响应日志-->
    <logger name="org.dromara.jpom.system.WebAopLog" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="LOG-ROOT"/>
        <appender-ref ref="STDOUT"/>
    </logger>

    <logger name="org.dromara.jpom" additivity="false">
        <level value="debug"/>
        <appender-ref ref="LOG-ROOT"/>
        <appender-ref ref="STDOUT"/>
    </logger>
</configuration>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy