logback.xml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <configuration>
  3. <!-- 输出日志到文件
  4. <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  5. <file>api.log</file>
  6. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  7. <FileNamePattern>api.%d{yyyy-MM-dd}.log</FileNamePattern>
  8. </rollingPolicy>
  9. <encoder>
  10. <Pattern>[%date{yyyy-MM-dd HH:mm:ss}][%-5level][%file:%line] %msg%n</Pattern>
  11. </encoder>
  12. </appender>
  13. -->
  14. <!-- 输出日志到控制台-->
  15. <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  16. <encoder>
  17. <pattern>%d{HH:mm:ss}[%-5level][%file:%line] %msg%n</pattern>
  18. </encoder>
  19. </appender>
  20. <!--
  21. <logger name="com.zdsoft.fortunet" level="DEBUG"/>
  22. <logger name="org.springframework" level="DEBUG"/>
  23. <logger name="org.apache.shiro" level="DEBUG"/>
  24. <root level="DEBUG">
  25. <appender-ref ref="FILE" />
  26. </root>
  27. -->
  28. <root level="ERROR">
  29. <appender-ref ref="STDOUT" />
  30. </root>
  31. <logger name="com.zdsoft" level="DEBUG"/>
  32. <!--additivity禁止向上传递-->
  33. <logger name="com.zdsoft.fortunet.model.dao" level="ERROR" additivity="false"/>
  34. <logger name="com.zdsoft.rock.common.model.dao" level="ERROR" additivity="false"/>
  35. </configuration>