1.在tomcat安装文件的bin目录下,修改catalina.sh文件,改变catalina.out目录;
CATALINA_OUT="CATALINA_BASE"/logs/catalina.out;
更改为:CATALINA_OUT=/LOGS/logs/catalina.out;----此为更改到服务区根目录的LOGS文件夹内
2.在tomcat安装文件的conf文件夹下,修改server.xml文件
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
改为
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="/LOGS/logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
3.修改项目log4j.properties所有级别日志文件的输出目录