zoukankan      html  css  js  c++  java
  • logback的简单配置

    logback的简单配置:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
            </encoder>
        </appender>
        <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
            <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                <fileNamePattern>logFile.%d{yyyy-MM-dd}.log</fileNamePattern>
                <maxHistory>30</maxHistory>
            </rollingPolicy>
            <encoder>
                <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
            </encoder>
        </appender>
        <root level="info">
            <appender-ref ref="STDOUT"/>
            <appender-ref ref="FILE"/>
        </root>
    </configuration>

     POM引用:

    <dependencies>      
    <!--logback dependencies-->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>${logback.version}</version>
    </dependency>
    </dependencies>
  • 相关阅读:
    [資料]VS2008技巧
    [資料]MarshalAs的用法
    MS SQL Server 2000安装不成功的原因
    Zend產品線
    [轉]Flex 开发必备10武器
    [轉]C#中的XML注释
    [轉]onpropertychange事件
    [轉]fckeditor添加自定义按钮
    [資源]Web設計資源以及线框工具
    [轉]JS中showModalDialog 详细使用
  • 原文地址:https://www.cnblogs.com/frankyou/p/9197993.html
Copyright © 2011-2022 走看看