作为Windows服务运行时的Tomcat日志记录 [英] Tomcat Logging while running as a windows service

查看:1309
本文介绍了作为Windows服务运行时的Tomcat日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Tomcat下运行的Web应用程序.

I have a web application running under Tomcat.

使用java.util.logging实现各种功能的记录.

Logging for various features is implemented using java.util.logging.

通过startup.bat运行tomcat时,将创建日志记录文件并按预期记录日志记录.

When running tomcat via startup.bat the logging files are created and record the logging as expected.

当使用相同的war文件作为Windows服务运行时,实际上缺少日志记录的输出.在stdout.log和stderr.log中有一些(几乎没有)日志输出,但是没有预期的结果.

When running as a windows service using the same war file the output from logging is virtually absent. There is some ( Barely any ) log output in stdout.log and stderr.log but not what is expected.

这听起来对任何人都熟悉吗?您采取了哪些步骤来纠正它?

Does this sound familiar to anyone? what steps did you take to correct it?

致谢

推荐答案

事实证明这是一个配置问题.

As it turns out this is a configuration problem.

当从startup.bat启动时,tomcat将引用conf目录中的logging.properties.

When started from the startup.bat tomcat will reference the logging.properties in the conf directory.

当作为服务启动时,jdk/jre/lib logging.properties就会起作用.

When started as a service the jdk/jre/lib logging.properties comes into play.

作为Windows服务运行时,所有控制台输出都将重定向到tomcat日志目录中的stdout.log.

When running as a windows service, all console output is redirected to stdout.log in the tomcat logs directory .

到目前为止,使用自定义logging.properties文件捕获自定义文件中的日志的尝试都失败了.

Attempts to capture logging in custom files with custom logging.properties files have so far failed.

这篇关于作为Windows服务运行时的Tomcat日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆