我正在运行一个本地jar文件,该文件使用tomcat7嵌入式tomcat和log4j进行日志记录。
java -jar thirdparty.jar
Apr 13, 2019 2:39:55 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 13, 2019 2:39:55 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Apr 13, 2019 2:39:55 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.37
Apr 13, 2019 2:39:58 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [140] milliseconds.
Apr 13, 2019 2:39:58 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Apr 13, 2019 2:39:58 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
此处的日志没有帮助。我尝试查看.extract / conf / logs文件夹中的日志,只能看到以下内容:
0:0:0:0:0:0:0:1 - - [12/Apr/2019:16:30:45 -0700] GET / HTTP/1.1 404 - http-bio-8080-exec-1 0
在运行jar时,有什么方法可以覆盖log4j的日志属性,以便在控制台上查看日志,以解决为什么tomcat无法启动?