简体   繁体   English

将tomcat输出从控制台重定向到/ logs

[英]Redirect tomcat output from console to /logs

My default tomcat configuration sends logs to the console, but i want it to be in /logs directory. 我的默认tomcat配置将日志发送到控制台,但是我希望它位于/ logs目录中。 How can i configure tomcat? 我该如何配置tomcat?

Use a logging framework like logback . 使用logback之类的日志框架。 There you can configure to log to a file rather than the console. 您可以在那里配置登录到文件而不是控制台。

You can find a comprehensive FAQ in the Tomcat WIKI. 您可以在Tomcat WIKI中找到全面的FAQ If you are referring to logging produced by web applications, then these should use a logging framework, as suggested by Bozho and the FAQ. 如果您指的是Web应用程序生成的日志记录,则应使用Bozho和FAQ所建议的日志记录框架。 Regarding messages produced by the Tomcat itself (catalina.out), you can configure the logging.properties file at conf directory. 关于Tomcat本身生成的消息(catalina.out),可以在conf目录中配置logging.properties文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM