vgritsenko 01/08/18 11:19:08
Modified: src/org/apache/cocoon/servlet Tag: cocoon_20_branch
CocoonServlet.java
webapp/WEB-INF Tag: cocoon_20_branch web.xml
Log:
Patch from Marcus Crafter to allow appending to the cocoon log
Revision Changes Path
No revision
No revision
1.13.2.17 +9 -2 xml-cocoon2/src/org/apache/cocoon/servlet/CocoonServlet.java
Index: CocoonServlet.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/servlet/CocoonServlet.java,v
retrieving revision 1.13.2.16
retrieving revision 1.13.2.17
diff -u -r1.13.2.16 -r1.13.2.17
--- CocoonServlet.java 2001/08/16 14:02:11 1.13.2.16
+++ CocoonServlet.java 2001/08/18 18:19:07 1.13.2.17
@@ -64,7 +64,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken Barozzi</a> Aisa
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.13.2.16 $ $Date: 2001/08/16 14:02:11 $
+ * @version CVS $Revision: 1.13.2.17 $ $Date: 2001/08/18 18:19:07 $
*/
public class CocoonServlet extends HttpServlet {
@@ -363,6 +363,9 @@
this.appContext.put(Constants.CONTEXT_LOG_FILE, logName);
+ String value = getInitParameter("log-append");
+ boolean logAppend = (value == null || value.equals("yes") ||
value.equals("true"));
+
final String path = logDir + logName;
Formatter formatter;
if (logFormat == null || logFormat.equalsIgnoreCase("xml") == false) {
@@ -378,7 +381,7 @@
this.log = Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon");
this.log.setPriority(logPriority);
- FileTarget fileTarget = new FileTarget(new File(path), false,
formatter);
+ FileTarget fileTarget = new FileTarget(new File(path), logAppend,
formatter);
ServletOutputLogTarget servTarget = new
ServletOutputLogTarget(this.servletContext);
servTarget.setFormatter(formatter);
@@ -387,6 +390,10 @@
filter.addTarget( servTarget );
LogTarget[] targets = new LogTarget[] { fileTarget, filter };
this.log.setLogTargets( targets );
+
+ if (logAppend)
+ this.log.info("Appending to previous log file, if existing");
+
} catch (Exception e) {
Hierarchy.getDefaultHierarchy().log("Could not set up Cocoon Logger,
will use screen instead", e);
}
No revision
No revision
1.1.1.1.2.7 +21 -0 xml-cocoon2/webapp/WEB-INF/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/WEB-INF/web.xml,v
retrieving revision 1.1.1.1.2.6
retrieving revision 1.1.1.1.2.7
diff -u -r1.1.1.1.2.6 -r1.1.1.1.2.7
--- web.xml 2001/08/09 12:24:02 1.1.1.1.2.6
+++ web.xml 2001/08/18 18:19:07 1.1.1.1.2.7
@@ -98,6 +98,16 @@
-->
<!--
+ This boolean value parameter specifies whether the cocoon log file
+ should be appended to or not.
+
+ <init-param>
+ <param-name>log-append</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ -->
+
+ <!--
Allow reinstantiating (reloading) of the cocoon instance. If this is
set to "yes" or "true", a new cocoon instance can be created using
the request parameter "cocoon-reload".
@@ -178,6 +188,17 @@
of your servlet engine.
-->
<load-on-startup>1</load-on-startup>
+
+ <!--
+ If you set this parameter to 'true' or 'yes', Cocoon will add processing
+ time to the end of each response. Value 'hide' adds processing time as an HTML
+ comment. By default, processing time is not added (corresponds to value 'no').
+
+ <init-param>
+ <param-name>show-time</param-name>
+ <param-value>hide</param-value>
+ </init-param>
+ -->
</servlet>
<servlet-mapping>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]