我需要在我的 tomcat7 安装的 catalina.out 日志文件中显示实际日志信息的日期和时间。从网上我找到了将这一行添加到 logging.properties 文件的解决方案,但它不起作用。我添加了以下内容:
1catalina.java.util.logging.SimpleFormatter.format=[%1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS,%1$tL
Run Code Online (Sandbox Code Playgroud)
现在它只是一堆零时间戳的数据。我只想要日志输出中INFO或ERROR等yyyymmdd hhmmss之前的标准。
现在在我的 logging.properties 文件中是这样的(我显然添加了最后一行):
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
1catalina.java.util.logging.SimpleFormatter.format=[%1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS,%1$tL
the version Im using is apache-tomcat-7.0.82.
Run Code Online (Sandbox Code Playgroud)
您能提供的任何帮助都会很棒,并在此先感谢您。
tomcat7 ×1