tomcat6: cannot create directory for logging in linux
i use ubuntu 9.04 for testing platform. I have created a webapp that log a hardcoded string whenever someone visit index.jsp. I have enable SECURITY_MANAGER in /etc/init.d/tomcat6. And I have grant permission for t开发者_开发问答he webapp named w1 with
grant codeBase "file:${catalina.base}/webapps/w1/-" {
permission java.security.AllPermission;
};
however, when i access the index.jsp with a browser, a
java.io.FileNotFoundException: /Log/10127-2010-10-14.log (No such file or directory)
is presented in catalina.out. The situation is that the directory of Log is not exist nor the log file.
If I create the directory myself, the log file will be created but with no context inside.
And I found it runs successfully in tomcat5.5 in another 8.04 box and tomcat6 in windows xp box.
Any ideas?
Can you not use the default logger?
<!-- Application context below -->
<Context path="/manager" docBase="/opt/tomcat6/webapps/manager" privileged="true" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="example.com._manager" suffix=".txt" timestamp="true"/>
</Context>
Inside your server.xml.
Yucca
精彩评论