cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric Glorieux <frederic.glori...@ajlsm.com>
Subject Cocoon read-only (ex: CD-ROM) add ${context-work} parameter to logkit.xconf from CocoonServlet.java
Date Wed, 27 Oct 2004 00:43:09 GMT

Hello,


For sysadmin, it may be important for the cocoon servlet to be totally 
read-only, even logs. I used to try to run a same cocoon in parallel in 
different servlet contexts (same JVM, same tomcat, different URIs). Logs 
were quite funny to read but a bit broken. For a fast patch, I added 2 
lines in *CocoonServlet.java* to make cocoon write is logs in work.

line 774
         subcontext.put("servlet-context", this.servletContext);
         if (this.servletContextPath == null) {
             File logSCDir = new File(this.workDir, "log");
             logSCDir.mkdirs();
             if (logger.isWarnEnabled()) {
                 logger.warn("Setting servlet-context for LogKit to " +  	
		logSCDir);
             }
             subcontext.put("context-root", logSCDir.toString());
+           subcontext.put("context-work", this.workDir);
         } else {
             subcontext.put("context-root", this.servletContextPath);
+           subcontext.put("context-work", this.workDir);
         }

Same is easy to do with a log Target, Forrest gave us an example here
http://svn.apache.org/viewcvs.cgi/forrest/trunk/src/java/org/apache/forrest/log/
but this is a so little change ? I can't guess consequences in a so 
central class.

-- 
Frédéric Glorieux (ingénieur documentaire, AJLSM)
<http://www.ajlsm.com>

Mime
View raw message