Tag: Tomcat/設定
handlers = 1catalina.org.apache.juli.AsyncFileHandler .handlers = 1catalina.org.apache.juli.AsyncFileHandler 1catalina.org.apache.juli.AsyncFileHandler.level = FINE 1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina. 1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90 1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access" suffix=".txt" rotatable="false" pattern="combined" />
$ sudo vim /etc/logrotate.d/tomcat8 /opt/tomcat/apache-tomcat-8.5.29/logs/catalina.out /opt/tomcat/apache-tomcat-8.5.29/logs/localhost_access.txt { copytruncate daily rotate 7 compress missingok create 0644 tomcat tomcat }
#!/bin/bash LOG_DIR=/opt/tomcat/apache-tomcat-8.5.29/logs/ delfiles=`find ${LOG_DIR}*.log -mtime +7` for a in $delfiles do echo -e "delete file: ${a}" > /dev/null 2>&1 rm -f ${a} done
eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \ -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \ org.apache.catalina.startup.Bootstrap "$@" stop