logback在SpringBoot下出现no applicable action for [appender], current ElementPath is [[configuration][a

可能因为最新版的不支持一些日志级别

注意看注释的地方


    
    
    
    
  1. xml version="1.0" encoding="UTF-8"?>
  2. <configuration debug="true">
  3. <property name="LOG_HOME" value="d:/log" />
  4. <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  5. <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
  6. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n pattern>
  7. encoder>
  8. appender>
  9. <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  10. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  11. <FileNamePattern>${LOG_HOME}/TestWeb.log.%d{yyyy-MM-dd-HH-mm}.log FileNamePattern>
  12. <MaxHistory>30 MaxHistory>
  13. rollingPolicy>
  14. <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
  15. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n pattern>
  16. encoder>
  17. <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
  18. <MaxFileSize>10MB MaxFileSize>
  19. triggeringPolicy>
  20. appender>
  21. <appender name="info1" class="ch.qos.logback.core.rolling.RollingFileAppender">
  22. <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  23. <level>INFO level>
  24. filter>
  25. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  26. <fileNamePattern>${LOG_HOME}/info.%d{yyyy-MM-dd}.log
  27. fileNamePattern>
  28. <maxHistory>15 maxHistory>
  29. rollingPolicy>
  30. <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
  31. <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} | %thread | %-5level | %class{20}:%file\(%line\) | %msg%n pattern>
  32. encoder>
  33. appender>
  34. <appender name="debug1" class="ch.qos.logback.core.rolling.RollingFileAppender">
  35. <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  36. <level>debug level>
  37. filter>
  38. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  39. <fileNamePattern>${LOG_HOME}/debug.%d{yyyy-MM-dd}.log
  40. fileNamePattern>
  41. <maxHistory>15 maxHistory>
  42. rollingPolicy>
  43. <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
  44. <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} | %thread | %-5level | %class{20}:%file\(%line\) | %msg%n pattern>
  45. encoder>
  46. appender>
  47. <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
  48. <logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
  49. <logger name="org.hibernate.SQL" level="DEBUG" />
  50. <logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
  51. <logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
  52. <logger name="com.apache.ibatis" level="TRACE"/>
  53. <logger name="java.sql.Connection" level="DEBUG"/>
  54. <logger name="java.sql.Statement" level="DEBUG"/>
  55. <logger name="java.sql.PreparedStatement" level="DEBUG"/>
  56. <root level="INFO">
  57. <appender-ref ref="STDOUT" />
  58. <appender-ref ref="FILE" />
  59. <appender-ref ref="info1" />
  60. <appender-ref ref="debug1" />
  61. root>
  62. configuration>

原文地址:https://blog.csdn.net/bestxianfeng163/article/details/83616492

你可能感兴趣的:(logback在SpringBoot下出现no applicable action for [appender], current ElementPath is [[configuration][a)