修改Tomcat默认日志catalina.out的路径

第一种方法

修改catalina.sh的$CATALINA_OUT路径即可

$TOMCAT_HOME/bin下面

vim /home/prod/tomcat/bin/catalina.sh 
188 if [ -z "$CATALINA_OUT" ] ; then
189   #CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out
190   CATALINA_OUT="/Data/logs/tomcat/catalina.out"
191 fi

第二种方法

实际上,我们更改的文件是:

/home/prod/tomcat/conf/logging.properties

vim /home/prod/tomcat/conf/logging.properties

我们可以看到:


...
 26 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
...
 30 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
...
 34 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
...
 38 4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
...

因此,我们也可以直接修改这个文件

你可能感兴趣的:(Java)