tomcat日誌輸出控制

當禁用tomcat管理頁面時,可是在服務器從啓動時,在tomcat默認的/aliyun/tomcat7/logs/ 存放日誌的目錄下依然還會生成關於host-manager,manager的日誌文件,他們此時是無用的,因此要禁止自動生成這些日誌,因此修改apache

[root@tomcat04 conf]# cat -n logging.properties |sed -n '33,41p;55,60p'
33 #####tomcat's log youhua by wujianwei 2016-5-10
34 #3manager.org.apache.juli.FileHandler.level = FINE
35 #3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
36 #3manager.org.apache.juli.FileHandler.prefix = manager.
37
38 #4host-manager.org.apache.juli.FileHandler.level = FINE
39 #4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
40 #4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
41 #####tomcat's log youhua by wujianwei 2016-5-10
55 #####tomcat's logs youhua by wujianwei 2016-5-10
56 #org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
57 #org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler
58 #org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
59 #org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler
60 ##### tomcat's logs youhua by wujianwei 2016-5-10vim

定時清理tomcat 生成的日誌:
[root@tomcat01 scripts]# vim /aliyun/scripts/tomcatlogs_clear.sh
#/bin/bash
path=/aliyun/tomcat7/logs
find $path/ -type f -name "tomcat01" -mtime +3|xargs rm -f
find $path/ -type f -name "catalina
" -mtime +3|xargs rm -f
find $path/ -type f -name "localhost*" -mtime +3|xargs rm -ftomcat

相關文章
相關標籤/搜索