idea中 logback不起作用
请问一下这是什么原因
使用的是idea
idea目录结构:
依赖包:
logback配置:
运行后已确定执行了logger.info()语句,下面的调试可以看到执行到这儿了 并且成功执行了这个controller:
但是从启动服务器到执行这个controller始终没有打印我自己的logger.info,但是启动时控制台有这样的error日志输出:
这里是补充控制台的右边信息:
正在回答 回答被采纳积分+1
同学你好,建议同学参考这个问答:http://class.imooc.com/course/qadetail/137924再试试。
祝:学习愉快~
控制台logback的error日志2:
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@54:25 - no applicable action for [MaxHistory], current ElementPath is [[configration][appender][rollingPolicy][MaxHistory]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@58:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@61:67 - no applicable action for [filter], current ElementPath is [[configration][appender][filter]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@62:20 - no applicable action for [level], current ElementPath is [[configration][appender][filter][level]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@64:22 - no applicable action for [onMatch], current ElementPath is [[configration][appender][filter][onMatch]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@66:25 - no applicable action for [onMisMatch], current ElementPath is [[configration][appender][filter][onMisMatch]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@71:92 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@73:15 - no applicable action for [file], current ElementPath is [[configration][appender][file]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@75:83 - no applicable action for [rollingPolicy], current ElementPath is [[configration][appender][rollingPolicy]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@77:30 - no applicable action for [fileNamePattern], current ElementPath is [[configration][appender][rollingPolicy][fileNamePattern]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@79:25 - no applicable action for [MaxHistory], current ElementPath is [[configration][appender][rollingPolicy][MaxHistory]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@82:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@83:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@86:67 - no applicable action for [filter], current ElementPath is [[configration][appender][filter]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@87:20 - no applicable action for [level], current ElementPath is [[configration][appender][filter][level]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@89:22 - no applicable action for [onMatch], current ElementPath is [[configration][appender][filter][onMatch]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@91:25 - no applicable action for [onMisMatch], current ElementPath is [[configration][appender][filter][onMisMatch]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@99:70 - no applicable action for [logger], current ElementPath is [[configration][logger]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@100:43 - no applicable action for [appender-ref], current ElementPath is [[configration][logger][appender-ref]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@101:42 - no applicable action for [appender-ref], current ElementPath is [[configration][logger][appender-ref]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@102:43 - no applicable action for [appender-ref], current ElementPath is [[configration][logger][appender-ref]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@105:25 - no applicable action for [root], current ElementPath is [[configration][root]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@106:45 - no applicable action for [appender-ref], current ElementPath is [[configration][root][appender-ref]]
15:37:20,561 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@76c4f18 - Registering current configuration as safe fallback point
这里是控制台logback打印的error日志1: (由于只能发8000字 分两次发)
15:37:20,441 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
15:37:20,442 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
15:37:20,442 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/D:/Users/jk/IdeaProjects/o2o/o2o-web/target/o2o-web/WEB-INF/classes/logback.xml]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:64 - no applicable action for [configration], current ElementPath is [[configration]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@6:47 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@7:49 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:63 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:111 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@12:82 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@15:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@20:92 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:15 - no applicable action for [file], current ElementPath is [[configration][appender][file]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:83 - no applicable action for [rollingPolicy], current ElementPath is [[configration][appender][rollingPolicy]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@26:30 - no applicable action for [fileNamePattern], current ElementPath is [[configration][appender][rollingPolicy][fileNamePattern]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@27:26 - no applicable action for [maxFileSize], current ElementPath is [[configration][appender][rollingPolicy][maxFileSize]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@29:25 - no applicable action for [MaxHistory], current ElementPath is [[configration][appender][rollingPolicy][MaxHistory]]
15:37:20,555 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@32:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@33:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:67 - no applicable action for [filter], current ElementPath is [[configration][appender][filter]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@37:20 - no applicable action for [level], current ElementPath is [[configration][appender][filter][level]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@39:22 - no applicable action for [onMatch], current ElementPath is [[configration][appender][filter][onMatch]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@41:25 - no applicable action for [onMisMatch], current ElementPath is [[configration][appender][filter][onMisMatch]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@46:91 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@48:15 - no applicable action for [file], current ElementPath is [[configration][appender][file]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@50:83 - no applicable action for [rollingPolicy], current ElementPath is [[configration][appender][rollingPolicy]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@52:30 - no applicable action for [fileNamePattern], current ElementPath is [[configration][appender][rollingPolicy][fileNamePattern]]
控制台信息第三部分:
action for [file], current ElementPath is [[configration][appender][file]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@75:83 - no applicable action for [rollingPolicy], current ElementPath is [[configration][appender][rollingPolicy]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@77:30 - no applicable action for [fileNamePattern], current ElementPath is [[configration][appender][rollingPolicy][fileNamePattern]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@79:25 - no applicable action for [MaxHistory], current ElementPath is [[configration][appender][rollingPolicy][MaxHistory]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@82:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@83:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@86:67 - no applicable action for [filter], current ElementPath is [[configration][appender][filter]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@87:20 - no applicable action for [level], current ElementPath is [[configration][appender][filter][level]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@89:22 - no applicable action for [onMatch], current ElementPath is [[configration][appender][filter][onMatch]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@91:25 - no applicable action for [onMisMatch], current ElementPath is [[configration][appender][filter][onMisMatch]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@99:70 - no applicable action for [logger], current ElementPath is [[configration][logger]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@100:43 - no applicable action for [appender-ref], current ElementPath is [[configration][logger][appender-ref]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@101:42 - no applicable action for [appender-ref], current ElementPath is [[configration][logger][appender-ref]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@102:43 - no applicable action for [appender-ref], current ElementPath is [[configration][logger][appender-ref]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@105:25 - no applicable action for [root], current ElementPath is [[configration][root]]
15:37:20,558 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@106:45 - no applicable action for [appender-ref], current ElementPath is [[configration][root][appender-ref]]
15:37:20,561 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@76c4f18 - Registering current configuration as safe fallback point
25-Jul-2019 15:37:20.677 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。
[2019-07-25 03:37:25,155] Artifact o2o-web:war exploded: Artifact is deployed successfully
[2019-07-25 03:37:25,156] Artifact o2o-web:war exploded: Deploy took 7,491 milliseconds
25-Jul-2019 15:37:26.432 信息 [http-nio-8080-exec-4] org.apache.tomcat.util.http.parser.Cookie.logInvalidHeader A cookie header was received [1563951376] that contained an invalid cookie. That cookie will be ignored.
Note: further occurrences of this error will be logged at DEBUG level.
25-Jul-2019 15:37:27.380 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [D:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager]
25-Jul-2019 15:37:28.375 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager] has finished in [995] ms
"D:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\catalina.bat" stop
Using CATALINA_BASE: "C:\Users\jk\.IntelliJIdea2018.3\system\tomcat\Unnamed_o2o"
Using CATALINA_HOME: "D:\Program Files\Apache Software Foundation\Tomcat 9.0"
Using CATALINA_TMPDIR: "D:\Program Files\Apache Software Foundation\Tomcat 9.0\temp"
Using JRE_HOME: "D:\Program Files\Java\jdk1.8.0_201"
Using CLASSPATH: "D:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;D:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar"
25-Jul-2019 15:41:28.921 信息 [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
25-Jul-2019 15:41:28.922 信息 [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
25-Jul-2019 15:41:29.311 信息 [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
25-Jul-2019 15:41:29.686 信息 [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
25-Jul-2019 15:41:29.731 信息 [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
25-Jul-2019 15:41:29.733 信息 [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
25-Jul-2019 15:41:29.734 信息 [main] org.apache.coyote.AbstractProtocol.destroy 正在摧毁协议处理器 ["http-nio-8080"]
25-Jul-2019 15:41:29.736 信息 [main] org.apache.coyote.AbstractProtocol.destroy 正在摧毁协议处理器 ["ajp-nio-8009"]
Disconnected from server
控制台信息2:
25-Jul-2019 15:37:17.345 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
25-Jul-2019 15:37:17.345 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.21]
25-Jul-2019 15:37:17.357 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"]
25-Jul-2019 15:37:17.372 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["ajp-nio-8009"]
25-Jul-2019 15:37:17.376 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in [61] milliseconds
Connected to server
[2019-07-25 03:37:17,665] Artifact o2o-web:war exploded: Artifact is being deployed, please wait...
15:37:20,441 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
15:37:20,442 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
15:37:20,442 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/D:/Users/jk/IdeaProjects/o2o/o2o-web/target/o2o-web/WEB-INF/classes/logback.xml]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:64 - no applicable action for [configration], current ElementPath is [[configration]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@6:47 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@7:49 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:63 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:111 - no applicable action for [property], current ElementPath is [[configration][property]]
15:37:20,553 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@12:82 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@15:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@20:92 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:15 - no applicable action for [file], current ElementPath is [[configration][appender][file]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:83 - no applicable action for [rollingPolicy], current ElementPath is [[configration][appender][rollingPolicy]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@26:30 - no applicable action for [fileNamePattern], current ElementPath is [[configration][appender][rollingPolicy][fileNamePattern]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@27:26 - no applicable action for [maxFileSize], current ElementPath is [[configration][appender][rollingPolicy][maxFileSize]]
15:37:20,554 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@29:25 - no applicable action for [MaxHistory], current ElementPath is [[configration][appender][rollingPolicy][MaxHistory]]
15:37:20,555 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@32:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@33:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:67 - no applicable action for [filter], current ElementPath is [[configration][appender][filter]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@37:20 - no applicable action for [level], current ElementPath is [[configration][appender][filter][level]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@39:22 - no applicable action for [onMatch], current ElementPath is [[configration][appender][filter][onMatch]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@41:25 - no applicable action for [onMisMatch], current ElementPath is [[configration][appender][filter][onMisMatch]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@46:91 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,556 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@48:15 - no applicable action for [file], current ElementPath is [[configration][appender][file]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@50:83 - no applicable action for [rollingPolicy], current ElementPath is [[configration][appender][rollingPolicy]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@52:30 - no applicable action for [fileNamePattern], current ElementPath is [[configration][appender][rollingPolicy][fileNamePattern]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@54:25 - no applicable action for [MaxHistory], current ElementPath is [[configration][appender][rollingPolicy][MaxHistory]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:18 - no applicable action for [encoder], current ElementPath is [[configration][appender][encoder]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@58:22 - no applicable action for [pattern], current ElementPath is [[configration][appender][encoder][pattern]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@61:67 - no applicable action for [filter], current ElementPath is [[configration][appender][filter]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@62:20 - no applicable action for [level], current ElementPath is [[configration][appender][filter][level]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@64:22 - no applicable action for [onMatch], current ElementPath is [[configration][appender][filter][onMatch]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@66:25 - no applicable action for [onMisMatch], current ElementPath is [[configration][appender][filter][onMisMatch]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@71:92 - no applicable action for [appender], current ElementPath is [[configration][appender]]
15:37:20,557 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@73:15 - no applicable
由于图片看不清楚 且只能提交8000字 我将控制台信息分3次发
控制台信息:
"D:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\catalina.bat" run
[2019-07-25 03:37:15,571] Artifact o2o-web:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\jk\.IntelliJIdea2018.3\system\tomcat\Unnamed_o2o"
Using CATALINA_HOME: "D:\Program Files\Apache Software Foundation\Tomcat 9.0"
Using CATALINA_TMPDIR: "D:\Program Files\Apache Software Foundation\Tomcat 9.0\temp"
Using JRE_HOME: "D:\Program Files\Java\jdk1.8.0_201"
Using CLASSPATH: "D:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;D:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar"
25-Jul-2019 15:37:16.867 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/9.0.21
25-Jul-2019 15:37:16.871 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.构建: Jun 4 2019 20:19:36 UTC
25-Jul-2019 15:37:16.871 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.21.0
25-Jul-2019 15:37:16.871 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
25-Jul-2019 15:37:16.871 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0
25-Jul-2019 15:37:16.872 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 结.造: amd64
25-Jul-2019 15:37:16.872 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: D:\Program Files\Java\jdk1.8.0_201\jre
25-Jul-2019 15:37:16.872 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 版本: 1.8.0_201-b09
25-Jul-2019 15:37:16.872 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation
25-Jul-2019 15:37:16.872 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\jk\.IntelliJIdea2018.3\system\tomcat\Unnamed_o2o
25-Jul-2019 15:37:16.872 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\Program Files\Apache Software Foundation\Tomcat 9.0
25-Jul-2019 15:37:16.874 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\jk\.IntelliJIdea2018.3\system\tomcat\Unnamed_o2o\conf\logging.properties
25-Jul-2019 15:37:16.874 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
25-Jul-2019 15:37:16.877 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=utf-8
25-Jul-2019 15:37:16.878 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
25-Jul-2019 15:37:16.878 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
25-Jul-2019 15:37:16.879 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
25-Jul-2019 15:37:16.879 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
25-Jul-2019 15:37:16.879 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
25-Jul-2019 15:37:16.880 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
25-Jul-2019 15:37:16.881 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
25-Jul-2019 15:37:16.881 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
25-Jul-2019 15:37:16.881 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\jk\.IntelliJIdea2018.3\system\tomcat\Unnamed_o2o
25-Jul-2019 15:37:16.882 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\Program Files\Apache Software Foundation\Tomcat 9.0
25-Jul-2019 15:37:16.882 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\Program Files\Apache Software Foundation\Tomcat 9.0\temp
25-Jul-2019 15:37:16.883 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\Program Files\Java\jdk1.8.0_201\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;D:\Program Files\TortoiseSVN\bin;D:\Program Files\VisualSVN Server\bin;C:\Users\jk\AppData\Local\Microsoft\WindowsApps;D:\Program Files\Java\jdk1.8.0_201\bin;D:\Program Files\Java\jdk1.8.0_201\jre\bin;D:\Program Files\apache-maven-3.6.0\bin;D:\Program Files\jad158g.win;C:\Program Files\MySQL\MySQL Server 8.0\bin;;.]
25-Jul-2019 15:37:17.272 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"]
25-Jul-2019 15:37:17.306 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["ajp-nio-8009"]
25-Jul-2019 15:37:17.314 信息 [main] org.apache.catalina.startup.Catalina.load 服务器在[754]毫秒内初始化
由于图片看不太清楚 我补充一下
logback配置:
<?xml version="1.0" encoding="UTF-8"?>
<!--debug:false 表示logback不输出自己内部程序的debug信息-->
<configration scan="true" scanPeriod="60 seconds" debug="false">
<!--定义参数常量-->
<!--trace<debug<info<waring<error-->
<property name="log.level" value="debug"/>
<property name="log.maxHistory" value="30"/>
<property name="log.filePath" value="E:/webapp/o2o/logs"/>
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"/>
<!--控制台设置-->
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<!--用于将日志信息转换成字符串又将这些信息输出到文件-->
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!--debug-->
<appender name="debugAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--文件路径-->
<file>${log.filePath}/debug.log</file>
<!--滚动策略,这里的策略使用的是按天-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--文件名-->
<fileNamePattern>${log.filePath}/debug/debug.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!--文件最大保存天数-->
<MaxHistory>${log.maxHistory}</MaxHistory>
</rollingPolicy>
<!--用于将日志信息转换成字符串又将这些信息输出到文件-->
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<!--过滤 只记录debug-->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<!--匹配则接收-->
<onMatch>accept</onMatch>
<!--不配置则拒绝-->
<onMisMatch>deny</onMisMatch>
</filter>
</appender>
<!--info-->
<appender name="infoAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--文件路径-->
<file>${log.filePath}/info.log</file>
<!--滚动策略,这里的策略使用的是按天-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--文件名-->
<fileNamePattern>${log.filePath}/info/info.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!--文件最大保存天数-->
<MaxHistory>${log.maxHistory}</MaxHistory>
</rollingPolicy>
<!--用于将日志信息转换成字符串又将这些信息输出到文件-->
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<!--过滤 只记录info-->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<!--匹配则接收-->
<onMatch>accept</onMatch>
<!--不配置则拒绝-->
<onMisMatch>deny</onMisMatch>
</filter>
</appender>
<!--error-->
<appender name="errorAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--文件路径-->
<file>${log.filePath}/error.log</file>
<!--滚动策略,这里的策略使用的是按天-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--文件名-->
<fileNamePattern>${log.filePath}/error/error.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!--文件最大保存天数-->
<MaxHistory>${log.maxHistory}</MaxHistory>
</rollingPolicy>
<!--用于将日志信息转换成字符串又将这些信息输出到文件-->
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<!--过滤 error-->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>error</level>
<!--匹配则接收-->
<onMatch>accept</onMatch>
<!--不配置则拒绝-->
<onMisMatch>deny</onMisMatch>
</filter>
</appender>
<!--配置logger对象 name:关注哪个包下的类 level:只记录哪个等级以上的日志信息-->
<!--additivity:表示继承root里面的appender 即此处将root中的consoleAppender
拿进来 root中的等级为info logger中的等级为debug 所以console输出时会按照logger的
等级debug来记录-->
<logger name="com.jk.o2o" level="${log.level}" additivity="true">
<appender-ref ref="debugAppender"></appender-ref>
<appender-ref ref="infoAppender"></appender-ref>
<appender-ref ref="errorAppender"></appender-ref>
</logger>
<!--根logger 如果上面logger的level没有指定 则默认继承root的level-->
<root level="debug">
<appender-ref ref="consoleAppender"></appender-ref>
</root>
</configration>
- 参与学习 人
- 提交作业 323 份
- 解答问题 8263 个
本阶段将带你学习主流框架SSM,以及SpringBoot ,打通成为Java工程师的最后一公里!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星