Author: stefano
Date: Thu Feb 10 22:51:44 2005
New Revision: 153370
URL: http://svn.apache.org/viewcvs?view=rev&rev=153370
Log:
substantial cleanup + documentation of the default logkit configuration file
[boy, haven't committed to cocoon anything substantial in a loooong while...]
Modified:
cocoon/trunk/src/webapp/WEB-INF/logkit.xconf
cocoon/trunk/src/webapp/WEB-INF/web.xml
Modified: cocoon/trunk/src/webapp/WEB-INF/logkit.xconf
URL:
http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/logkit.xconf?view=diff&r1=153369&r2=153370
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/logkit.xconf (original)
+++ cocoon/trunk/src/webapp/WEB-INF/logkit.xconf Thu Feb 10 22:51:44 2005
@@ -1,304 +1,136 @@
-<?xml version="1.0" encoding="UTF-8"?><!--
- Copyright 1999-2004 The Apache Software Foundation
+<?xml version="1.0" encoding="UTF-8"?>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
---><logkit>
+<!--+
+ | This is the cocoon logkit configuration file.
+ |
+ | By default, Cocoon uses Excalibur logkit for logging, but it also
+ | supports Log4J. In case you want to use Log4J, you have to modify
+ | a configuration property in the 'WEB-INF/web.xml' file (search
+ | for log4j and you find it)
+ |
+ | The comments below should get you started in adapting the logs
+ | for your needs, but if you want to know more please visit
+ |
+ | http://wiki.apache.org/cocoon/ConfiguringTheLogs
+ |
+ +-->
+
+<logkit>
+
+ <!--+
+ | Factories are responsible to create the consumers of the log events,
the targets.
+ | Here we have configured just a few, the main cocoon target factory
(that prints to a file)
+ | and the servlet target factory (that prints back to the servlet
container log stream) but
+ | for more info on the available logkit factories, please consult
+ |
http://excalibur.apache.org/apidocs/org/apache/avalon/excalibur/logger/factory/package-summary.html
+ +-->
<factories>
- <factory
class="org.apache.avalon.excalibur.logger.factory.PriorityFilterTargetFactory"
type="priority-filter"/>
- <factory
class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory"
type="servlet"/>
- <factory class="org.apache.cocoon.util.log.CocoonTargetFactory"
type="cocoon"/>
- <factory
class="org.apache.avalon.excalibur.logger.factory.LF5TargetFactory" type="lf5"/>
+ <factory type="cocoon"
class="org.apache.cocoon.util.log.CocoonTargetFactory"/>
+ <factory type="servlet"
class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory"/>
</factories>
+ <!--+
+ | Targets are the instances of the consumers of the log events and
various
+ | instances can be configured and referenced via their 'id'.
+ | Note how the element name of the target indicates what type of factory
+ | that is created with.
+ +-->
<targets>
- <!-- To enable the LogFactor5 graphical logkit browser, replace the cocoon
factory
- below with the following.
- <lf5 id="core"/>
- -->
-
- <cocoon id="core">
- <filename>${context-root}/WEB-INF/logs/core.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <!--
- append=false: Will override existing log files on Cocoon startup
- append=true: Will append to the existing log files
- -->
- <append>false</append>
- <!--
- rotation: allows you to rotate log files one they meet certain
- criteria. In example below, files are rotated once they
- are one hour old or bigger than 100 Mb.
-
- <rotation type="revolving" init="1" max="4">
+ <cocoon id="main">
+ <!--+
+ | <filename> is the absolute location of the log file, note how you
can
+ | use the ${context-root} variable to indicate the root of the
+ | cocoon web application (the directory that contains WEB-INF, that
is)
+ +-->
+ <filename>${context-root}/WEB-INF/logs/cocoon.log</filename>
+
+ <!--+
+ | <format> indicates how the log event should be serialized.
+ | Note that newlines are *not* automatic: you have to specify the
+ | newline as '\n' or everything will appear on a single line!
+ | The first format below is less verbose because it won't print out
+ | the error stacktrace (which tend to be very verbose and for little
value).
+ | If you need the stacktraces, uncomment the second format below.
+ +-->
+ <format type="cocoon">%7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n</format>
+ <!--format type="cocoon">%7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}</format-->
+
+ <!--+
+ | <append> if set to 'true' will make cocoon append the events
+ | to the existing file, if set to 'false' cocoon will override
+ | the existing ones at every new start.
+ +-->
+ <append>true</append>
+
+ <!--+
+ | <rotation> allows you to rotate log files one they meet certain
+ | criteria. If you uncomment the example below, the log files will
+ | be rotated once they are a day old or bigger than 100 Mb.
+ +-->
+ <!--rotation type="unique" pattern="yyyyMMdd" suffix=".log">
<or>
<size>100m</size>
- <time>01:00:00</time>
+ <time>24:00:00</time>
</or>
- </rotation>
- -->
- </cocoon>
-
- <cocoon id="sitemap">
- <filename>${context-root}/WEB-INF/logs/sitemap.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
- <cocoon id="handled-errors">
- <filename>${context-root}/WEB-INF/logs/handled-errors.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
- <cocoon id="access">
- <filename>${context-root}/WEB-INF/logs/access.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
- <!-- The logger for the flow layer -->
- <cocoon id="flow">
- <filename>${context-root}/WEB-INF/logs/flow.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
- <!--
- This log file gets only messages with log level ERROR and below.
- -->
- <priority-filter id="error" log-level="ERROR">
- <cocoon>
- <filename>${context-root}/WEB-INF/logs/error.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
- </priority-filter>
-
-
- <cocoon id="forms">
- <filename>${context-root}/WEB-INF/logs/forms.log</filename>
-
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
-
-
- <cocoon id="apples">
- <filename>${context-root}/WEB-INF/logs/apples.log</filename>
-
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
-
- <!-- The logger for the cron components -->
- <cocoon id="cron">
- <filename>${context-root}/WEB-INF/logs/cron.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] %{thread}/%{class:short}:
%{message}\n%{throwable}
- </format>
- <append>true</append>
+ </rotation-->
</cocoon>
-
- <cocoon id="portal">
- <filename>${context-root}/WEB-INF/logs/portal.log</filename>
-
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
-
- <!-- The logger for the Slide components -->
- <cocoon id="slide">
- <filename>${context-root}/WEB-INF/logs/slide.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-
- <cocoon id="commons">
- <filename>${context-root}/WEB-INF/logs/commons.log</filename>
- <format type="cocoon">
- %7.7{priority} %{time} [%{category}] (%{uri})
%{thread}/%{class:short}: %{message}\n%{throwable}
- </format>
- <append>false</append>
- </cocoon>
-</targets>
-
+ <servlet id="servlet">
+ <format type="extended">%7.7{priority} %5.5{time} [%8.8{category}]
(%{context}): %{message}\n</format>
+ </servlet>
+
+ </targets>
+
+ <!--+
+ | Categories 'route' log events to particular targets, filtering
+ | on importance level (one of DEBUG, INFO, WARN, ERROR, FATAL_ERROR,
+ | ordered from most verbose to least verbose) and on the 'category'
+ | used by the producer of the log event to further classify it.
+ | Some of these log categories are hardwired in the code and some
+ | others are user-selectable, for example for sitemap components
+ | where you can specify the category in their sitemap declaration.
+ |
+ | Category names can be dot-separated (example, 'sitemap.generator.file')
+ | and the variuos pieces are treated as 'sub-categories'. By nesting
+ | the <category> element you achieve sub-category filtering and you can
+ | even have different log level filtering per category and subcategory.
+ | (See the comments below for an example of this)
+ |
+ | NOTE: not all subcategories are defined in this file. Not defined
+ | subcategories will be created automatically and they will inherit
+ | the settings of the parent subcategory. When defining a subcategory
+ | manually, it is required that you specify the log target, because
+ | they are not inherited in this case.
+ +-->
<categories>
- <!--
- log-level: One of DEBUG, INFO, WARN, ERROR, FATAL_ERROR.
- Log level could be different for every category and subcategory.
-
- Not all subcategories are defined in this file. Not defined
- subcategories will be created automatically inheriting settings
- of the parent subcategory.
- When defining subcategory manually, it is required to specify log
- targets, because they are not inherited in this case.
- -->
-
-
- <category log-level="DEBUG" name="org">
- <log-target id-ref="commons"/>
- <log-target id-ref="error"/>
-
- <category log-level="DEBUG" name="apache">
- <log-target id-ref="commons"/>
- <log-target id-ref="error"/>
-
- <category log-level="DEBUG" name="jci">
- <log-target id-ref="commons"/>
- <log-target id-ref="error"/>
- </category>
-
- <category log-level="DEBUG" name="commons">
- <log-target id-ref="commons"/>
- <log-target id-ref="error"/>
-
- <category log-level="DEBUG" name="javaflow">
- <log-target id-ref="commons"/>
- <log-target id-ref="error"/>
- </category>
- </category>
-
- </category>
- </category>
-
- <category log-level="INFO" name="core">
-
- <!-- Startup component manager logger -->
- <category log-level="INFO" name="startup">
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
+ <!--+
+ | This is the main category. The empty name attribute indicates that
+ | this rule will match all log events from all categories.
+ +-->
+ <category log-level="ERROR" name="">
+ <log-target id-ref="main"/>
+ </category>
+
+ <!--+
+ | This is a little more elaborate example, where some of the logs are
+ | sent to the log file and some others (the ones related to the
sitemap),
+ | are sent to the servlet container (where they could be further
relayed
+ | to the console, for example)
+ +-->
+ <!--category log-level="ERROR" name="">
+ <category log-level="DEBUG" name="sitemap">
+ <log-target id-ref="servlet"/>
</category>
-
- <category log-level="INFO" name="roles">
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
-
- <category log-level="INFO" name="instrument">
- <category log-level="INFO" name="values">
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
-
- <!-- Cocoon component manager logger -->
- <category log-level="INFO" name="manager">
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
-
- <!-- Cocoon cache and stores logger -->
- <category log-level="INFO" name="store">
- <category log-level="INFO" name="janitor">
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
-
- <log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
-
- <category log-level="INFO" name="sitemap">
- <log-target id-ref="sitemap"/>
- <log-target id-ref="error"/>
-
- <category log-level="INFO" name="handled-errors">
- <!-- Exceptions that will be handled by a sitemap errorhandler are
- logged to this target. -->
- <log-target id-ref="handled-errors"/>
- </category>
- </category>
-
- <category log-level="INFO" name="access">
- <log-target id-ref="access"/>
- <log-target id-ref="error"/>
- </category>
-
- <category log-level="DEBUG" name="flow">
- <log-target id-ref="flow"/>
- <log-target id-ref="error"/>
- </category>
-
- <category log-level="INFO" name="">
<log-target id-ref="core"/>
- <log-target id-ref="error"/>
- </category>
-
-
- <category log-level="ERROR" name="forms">
- <log-target id-ref="forms"/>
- <log-target id-ref="error"/>
- </category>
-
-
-
- <category log-level="ERROR" name="apples">
- <log-target id-ref="apples"/>
- <log-target id-ref="error"/>
- </category>
+ </category-->
+ </categories>
-
- <category log-level="INFO" name="cron">
- <log-target id-ref="cron"/>
- <log-target id-ref="error"/>
- </category>
-
-
-
- <category log-level="ERROR" name="portal">
- <log-target id-ref="portal"/>
- <log-target id-ref="error"/>
- </category>
-
-
- <category log-level="INFO" name="slide">
- <log-target id-ref="slide"/>
- <log-target id-ref="error"/>
- </category>
-</categories>
-
- <!-- Include logging confs from different blocks -->
+ <!--+
+ | Include logging confs from different blocks
+ +-->
<include dir="context://WEB-INF/xconf" pattern="*.logkit"/>
+
</logkit>
Modified: cocoon/trunk/src/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/web.xml?view=diff&r1=153369&r2=153370
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/web.xml (original)
+++ cocoon/trunk/src/webapp/WEB-INF/web.xml Thu Feb 10 22:51:44 2005
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?><!--
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
Copyright 1999-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<!--+
| This is the Cocoon web-app configurations file
+-->
@@ -135,7 +137,7 @@
-->
<init-param>
<param-name>log-level</param-name>
- <param-value>DEBUG</param-value>
+ <param-value>WARN</param-value>
</init-param>
<!--