有没有可能看到 *.war 文件执行的日志?
Is there any possibility to see logs of *.war file execution?
我使用
启动了我的 Web 应用程序
java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port 9000 *.war
现在有什么办法可以查看日志吗?
我的控制台输出:
sergei_rudenkov@EPAm18851:~/IdeaProjects/fsdf$ java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port 9000 web-archive-test.war
Adding Context for web-archive-test.war
Feb 05, 2016 2:18:33 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-9000"]
Feb 05, 2016 2:18:33 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feb 05, 2016 2:18:33 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Feb 05, 2016 2:18:33 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.24
Feb 05, 2016 2:18:33 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
Feb 05, 2016 2:18:33 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 05, 2016 2:18:33 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-9000"]
我的浏览器:
我在 application.properties
中有 logging.file=mylog.log
,但它没有写任何东西。
我使用此命令 jar cvf web-archive-test.war .
创建了 war 文件
有趣的是,当我从 Idea 启动它时一切正常。
您实施了日志系统?
- 否: 去
C:\Program Files\Apache Software Foundation\Tomcat x.x\logs
找他们
是
您在配置中提供了特定的日志文件夹?
- 是在服务器文件系统中搜索此文件夹位置。
- 否搜索您的日志系统的默认日志文件夹。
我使用
启动了我的 Web 应用程序java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port 9000 *.war
现在有什么办法可以查看日志吗?
我的控制台输出:
sergei_rudenkov@EPAm18851:~/IdeaProjects/fsdf$ java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port 9000 web-archive-test.war
Adding Context for web-archive-test.war
Feb 05, 2016 2:18:33 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-9000"]
Feb 05, 2016 2:18:33 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feb 05, 2016 2:18:33 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Feb 05, 2016 2:18:33 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.24
Feb 05, 2016 2:18:33 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
Feb 05, 2016 2:18:33 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 05, 2016 2:18:33 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-9000"]
我的浏览器:
我在 application.properties
中有 logging.file=mylog.log
,但它没有写任何东西。
我使用此命令 jar cvf web-archive-test.war .
创建了 war 文件
有趣的是,当我从 Idea 启动它时一切正常。
您实施了日志系统?
- 否: 去
C:\Program Files\Apache Software Foundation\Tomcat x.x\logs
找他们 是
您在配置中提供了特定的日志文件夹?
- 是在服务器文件系统中搜索此文件夹位置。
- 否搜索您的日志系统的默认日志文件夹。