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

nzabo.codegen.codegen-core.1.0-RELEASE.source-code.logback.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0"?>
<configuration>

    <!-- ch.qos.logback.core.ConsoleAppender 控制台输出 -->
    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>[%-5level] %d{HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n
            </pattern>
        </encoder>
    </appender>

    <!-- ch.qos.logback.core.rolling.RollingFileAppender 文件日志输出 -->
    <appender name="file"
              class="ch.qos.logback.core.rolling.RollingFileAppender">
        <Encoding>UTF-8</Encoding>
        <File>d:/codegen/codegen.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>d:/codegen/codegen-%d{yyyy-MM-dd}.log
            </FileNamePattern>
            <MaxHistory>10</MaxHistory>
            <TimeBasedFileNamingAndTriggeringPolicy
                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <MaxFileSize>5MB</MaxFileSize>
            </TimeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>[%-5level] %d{HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n
            </pattern>
        </layout>
    </appender>

    <!-- 日志级别 -->
    <root>
        <!-- 定义了ERROR和INFO级别的日志,分别在FILE文件和控制台输出 -->
        <level value="error"/>
        <level value="info"/>
        <appender-ref ref="file"/>
        <appender-ref ref="console"/>
    </root>
    <logger name="com.github.lynzabo.codegen" additivity="false">
        <level value="debug"/>
        <appender-ref ref="file"/>
        <appender-ref ref="console"/>
    </logger>

</configuration>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy