linux system to modify the tomcat default input log path
- 2020-10-07 18:57:13
- OfStack
1. Modify catalina.sh
Go to the tomcat installation directory /bin, find catalina.sh and make a backup first.
Make a change to the local catalina.sh. Here is an example of changing the log directory to /data/logs
$CATALINA_BASE/logs/catalina.out改为CATALINA_OUT=/data/logs
.
2. Modify logging.properties
Go to the tomcat installation directory /conf/, find logging.properties and make a backup first.
Modify the local ES29en. properties to change all ${catalina. base}/logs to /data/logs
3. Modify server.xml
Go to tomcat installation directory /conf/, find server.xml, make a backup first.
Change the local ES48en.xml to directory="/data/logs" as shown in the red box below
4. Modify log4ES56en.ES57en
If there is a log configuration in the web application, make the changes synchronously. For example, it is usually done in log4ES62en.properties.
5. Build soft links
Go to the tomcat directory and execute ES69en-ES70en /data/logs./logs
You can establish a link to/logs /logs for the logs directory.
Here only describes the linux system to modify the default logs, windows system is similar.
conclusion