简体   繁体   English

tomcat6:无法创建用于登录Linux的目录

[英]tomcat6: cannot create directory for logging in linux

i use ubuntu 9.04 for testing platform. 我使用ubuntu 9.04作为测试平台。 I have created a webapp that log a hardcoded string whenever someone visit index.jsp. 我创建了一个webapp,当有人访问index.jsp时,它会记录一个硬编码的字符串。 I have enable SECURITY_MANAGER in /etc/init.d/tomcat6. 我在/etc/init.d/tomcat6中启用了SECURITY_MANAGER。 And I have grant permission for the webapp named w1 with 我已经授予了名为w1的Web应用的许可,

grant codeBase "file:${catalina.base}/webapps/w1/-" {
    permission java.security.AllPermission;
};

however, when i access the index.jsp with a browser, a 但是,当我使用浏览器访问index.jsp时,

java.io.FileNotFoundException: /Log/10127-2010-10-14.log (No such file or directory) java.io.FileNotFoundException:/Log/10127-2010-10-14.log(无此类文件或目录)

is presented in catalina.out. 在catalina.out中显示。 The situation is that the directory of Log is not exist nor the log file. 情况是Log目录不存在,也不存在日志文件。

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. 我发现它在另一个8.04框的tomcat5.5和Windows XP框中的tomcat6中成功运行。

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. 在您的server.xml中。

Yucca 丝兰

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM