当禁用tomcat管理页面时,但是在服务器从启动时,在tomcat默认的/aliyun/tomcat7/logs/ 存放日志的目录下依然还会生成关于host-manager,manager的日志文件,他们此时是无用的,所以要禁止自动生成这些日志,所以修改
[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-10
定时清理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 -f
本文转自 wjw555 51CTO博客,原文链接:http://blog.51cto.com/wujianwei/2056455