启动tomcat出错后退出,tomcat老把日志写进local_xxx.log文件里面去,很不方便,能不能直接输出在控制台上?
解决办法,改server.xml,把
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
改成
<Logger className="org.apache.catalina.logger.SystemOutLogger"
timestamp="true"/>
Tomcat中限制访问者的ip或是host
<Context path="/examples" ...>
...
<Valve className="org.apache.catalina.valves.RemoteHostValve"
allow="*.mycompany.com,www.yourcompany.com"/>
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
deny="192.168.1.*"/>
...
</Context>