修改Tomcat目錄的conf/server.xml web
在 apache
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"> app
添加以下內容: webapp
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="%{X-Real-IP}i %v %t %r %s %b %D" resolveHosts="false"/> spa
這樣在Tomcat的logs目錄下就有日誌文件了: 日誌
catalina.out server
host-manager.2015-07-27.log xml
localhost.2015-07-27.log io
localhost_access_log.2015-07-27.txt class
manager.2015-07-27.log