config_default.logback.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2019 Of Him Code Technology Studio Jpom is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details. --> <configuration scan="true" scanPeriod=" 5 seconds"> <!--动态定义日志路径,请勿修改将影响查看系统日志功能--> <define name="logPath" class="org.dromara.jpom.system.ServerLogbackConfig"/> <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>server</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"/> </root> <logger name="org.springframework.web.servlet.DispatcherServlet" additivity="false"> <!-- 打印请求信息 debug 才输出 --> <level value="INFO"/> <appender-ref ref="LOG-ROOT"/> </logger> <logger name="org.dromara.jpom.system.WebAopLog" additivity="false"> <!--请求响应日志 debug 才输出--> <level value="INFO"/> <appender-ref ref="LOG-ROOT"/> </logger> <logger name="org.dromara.jpom" additivity="false"> <!--建议使用 info 级别--> <level value="INFO"/> <appender-ref ref="LOG-ROOT"/> </logger> </configuration>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy