正如我在標題中提到的,我的slf4j tomcat日誌記錄配置存在問題。事情是,雖然我可以將catalina.out轉換爲像日常appender這樣的不同文件,但是catalina.out文件本身仍在繼續增長,我無法弄清楚原因。Tomcat日誌記錄catalina.out正在不斷增加
順便說一句,我已經使用我的應用程序的日誌文件,以便使用slf4j logger.info調試和任何其他功能,但是我仍然需要catalina.out來從控制檯上看到正在發生的事情。這就是爲什麼我需要同時繼續使用catalina.out和myApplication.log。
這裏是我的tomcat記錄下TOMCAT_HOME性能/ conf目錄
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler
1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.
4host-manager.org.apache.juli.FileHandler.level = FINE
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler
你問的是錯誤的問題。正確的問題是爲什麼首先將任何東西寫入catalina.out。當Tomcat啓動和停止時,該文件應該會看到一些條目。其他任何事情都是問題的表徵。 – 2012-04-04 18:54:03
你說得對!我正在研究爲什麼它的行爲如此.. – Javatar 2012-12-04 09:44:11