2010-10-14 52 views
1

我使用ubuntu 9.04進行測試平臺。我創建了一個webapp,在有人訪問index.jsp時記錄一個硬編碼的字符串。我在/etc/init.d/tomcat6中啓用了SECURITY_MANAGER。我必須跟tomcat6:無法創建用於登錄linux的目錄

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

然而,對於名爲W1的web應用程序授予權限,當我訪問的index.jsp用瀏覽器,

java.io.FileNotFoundException: /日誌/ 10127- 2010-10-14.log(沒有 文件或目錄)

存在於catalina.out。情況是Log的目錄不存在,也不存在日誌文件。

如果我自己創建目錄,則會創建日誌文件,但是沒有上下文。

我發現它在Tomcat5.5中的另一個8.04盒子和tomcat6在Windows XP盒子中成功運行。

任何想法?

回答

0

你不能使用默認記錄器嗎?

<!-- 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> 

在你的server.xml中。

Yucca