Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

The problem for "logback-spring.xml" cannot be resolved

I'm trying to set up "Logback". The xml file was created as follows, but errors occur on the third line of [configuration debug="true"] and the bottom line of [root level="error"].

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<configuration debug="true">
    <!-- Appenders -->
    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <Pattern>%d %5p [%c] %m%n</Pattern>
        </encoder>
    </appender>

    <appender name="console-infolog" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <Pattern>%d %5p %m%n</Pattern>
        </encoder>
    </appender>

    
    <logger name="board" level="DEBUG" appender-ref="console"/>
    <logger name="jdbc.sqlonly" level="INFO" appender-ref="console-infolog"/>
    <logger name="jdbc.resultsettable" level="INFO" appender-ref="console-infolog"/>
    <logger name="org.springframework" level="error"/>
    <logger name="org.springframework.jdbc" level="error"/>

    
    <root level="error">
        <appender-ref ref="console"/>
    </root>
</configuration>

enter image description here This is the error log. /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=49635:/Applications/IntelliJ IDEA.app/Contents/bin -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath /Users/seojeongyu/IdeaProjects/board/build/classes/java/main:/Users/seojeongyu/IdeaProjects/board/build/resources/main:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-configuration-processor/2.4.1/d42331b683340464cf7027bf55df6ec52d088eb5/spring-boot-configuration-processor-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.16/6dc192c7f93ec1853f70d59d8a6dcf94eb42866/lombok-1.18.16.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.mybatis.spring.boot/mybatis-spring-boot-starter/2.1.4/1ad97a0fb96ec3630e598e5aaae2dbd2fd29fdb0/mybatis-spring-boot-starter-2.1.4.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-jdbc/2.4.1/8bce44479b03c6418f91370063ca770ca3ec6184/spring-boot-starter-jdbc-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-thymeleaf/2.4.1/d8eaea235e36763532110e0ea0ea76515abd1829/spring-boot-starter-thymeleaf-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/2.4.1/fb70dcc55475177dd404c5577c6d64b6c591c9cd/spring-boot-starter-web-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/2.4.1/15d81ffe81e26de37986d491e1cf4c1e3a324ca3/spring-boot-starter-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.mybatis.spring.boot/mybatis-spring-boot-autoconfigure/2.1.4/190f1630d0f7dee0dfecbacf7216b2b60391c046/mybatis-spring-boot-autoconfigure-2.1.4.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.mybatis/mybatis/3.5.6/28ea8fe7d6c3998cf1d0cb8af64b9d58f04c7cb3/mybatis-3.5.6.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.mybatis/mybatis-spring/2.0.6/eae03712acdf041a3590b816460945d4bd2691bc/mybatis-spring-2.0.6.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/com.zaxxer/HikariCP/3.4.5/aa1a2c00aae8e4ba8308e19940711bb9525b103d/HikariCP-3.4.5.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jdbc/5.3.2/9c1d028a63d9df3c692a105c107cbeeed835d966/spring-jdbc-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.thymeleaf/thymeleaf-spring5/3.0.11.RELEASE/de7bf0adf13b5e9c4811f95edf18279da193c0c6/thymeleaf-spring5-3.0.11.RELEASE.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.thymeleaf.extras/thymeleaf-extras-java8time/3.0.4.RELEASE/36e7175ddce36c486fff4578b5af7bb32f54f5df/thymeleaf-extras-java8time-3.0.4.RELEASE.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-json/2.4.1/5a4b7088c88be531cb416ef218da3e19309f8cea/spring-boot-starter-json-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-tomcat/2.4.1/92c0d7938bdf47fb9d3781aef94b07f5a940a263/spring-boot-starter-tomcat-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/5.3.2/6c1106b59db4c91682b740d2deaa3f02400ea8c8/spring-webmvc-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/5.3.2/5ea6e1536ee6a70bb5c2efbd579c688c09a93a4b/spring-web-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/2.4.1/9af62d8d15ee71efb9baf35dc5263fc953230ab1/spring-boot-autoconfigure-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/2.4.1/92bf6245c590b56ecb10d8d39ffe04ab0cdfee9/spring-boot-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-logging/2.4.1/5e83cd807e8fe6a25dd36a37ad9222e9d1309336/spring-boot-starter-logging-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/jakarta.annotation/jakarta.annotation-api/1.3.5/59eb84ee0d616332ff44aba065f3888cf002cd2d/jakarta.annotation-api-1.3.5.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.3.2/152489ed8223a6ad19065a3cd1ee6b9e20c0b82f/spring-core-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.27/359d62567480b07a679dc643f82fc926b100eed5/snakeyaml-1.27.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.30/b5a4b6d16ab13e34a88fae84c35cd5d68cac922c/slf4j-api-1.7.30.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/5.3.2/b0cd6f30a39666e28006a23059a600986dfcbbe1/spring-tx-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/5.3.2/289d8047f7cc524d60ca0c4cc6fedb8cb003e02d/spring-beans-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.thymeleaf/thymeleaf/3.0.11.RELEASE/628ebb91f520053d4120b7b18bf78ff295d57461/thymeleaf-3.0.11.RELEASE.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.11.3/dcdfce3e4af9da18d69b1be6f3d7c91256105831/jackson-datatype-jdk8-2.11.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.11.3/dd53d93fd448b345eeb75bec336d9c91dc56b796/jackson-datatype-jsr310-2.11.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-parameter-names/2.11.3/ab66d5c5b8008161ae89be8a3d98efff9ef1b915/jackson-module-parameter-names-2.11.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.11.3/4f7b27416934dc929bb6c2d2c5fe521829e6a4ec/jackson-databind-2.11.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-websocket/9.0.41/b6e5fdc2a4088c340d0916468d7e2ecff71d83d/tomcat-embed-websocket-9.0.41.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/9.0.41/a43e9711e85073187d04b137882b4b7957180ef0/tomcat-embed-core-9.0.41.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.glassfish/jakarta.el/3.0.3/dab46ee1ee23f7197c13d7c40fce14817c9017df/jakarta.el-3.0.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context/5.3.2/83ff3909a582eceb5c8ae152f1e510672106f42b/spring-context-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aop/5.3.2/c01aecb495a37786b5d6b7e9701c6f78353b61e6/spring-aop-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/5.3.2/31cfebc4f74de54ddf4298cc6fa4de4090486c41/spring-expression-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-to-slf4j/2.13.3/966f6fd1af4959d6b12bfa880121d4a2b164f857/log4j-to-slf4j-2.13.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.30/d58bebff8cbf70ff52b59208586095f467656c30/jul-to-slf4j-1.7.30.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jcl/5.3.2/5a9fc63ea825fe0de40cefd6d4985490ceabefbb/spring-jcl-5.3.2.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.attoparser/attoparser/2.0.5.RELEASE/a93ad36df9560de3a5312c1d14f69d938099fa64/attoparser-2.0.5.RELEASE.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.unbescape/unbescape/1.1.6.RELEASE/7b90360afb2b860e09e8347112800d12c12b2a13/unbescape-1.1.6.RELEASE.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.11.3/c2351800432bdbdd8284c3f5a7f0782a352aa84a/jackson-core-2.11.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.11.3/25d4e9c777e7a8805c4a000a8629d3009c779c9b/jackson-annotations-2.11.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.3/864344400c3d4d92dfeb0a305dc87d953677c03c/logback-core-1.2.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.13.3/ec1508160b93d274b1add34419b897bae84c6ca9/log4j-api-2.13.3.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-devtools/2.4.1/22d4eca38aa8a7304bccc845a3cca42c77d3e9a2/spring-boot-devtools-2.4.1.jar:/Users/seojeongyu/.gradle/caches/modules-2/files-2.1/mysql/mysql-connector-java/8.0.22/ec8bfce16c8bd18d6cb598b1147aa145be1408f/mysql-connector-java-8.0.22.jar com.example.board.BoardApplication 23:43:30,726 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] 23:43:30,727 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [console] 23:43:30,729 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property 23:43:30,737 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] 23:43:30,737 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [console-infolog] 23:43:30,737 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property 23:43:30,737 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [board] to DEBUG 23:43:30,737 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@650925bb - Propagating DEBUG level on Logger[board] onto the JUL framework 23:43:30,737 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [jdbc.sqlonly] to INFO 23:43:30,737 |-INFO in ch.qos.logback.clas


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...