You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2005/03/30 19:39:22 UTC

svn commit: r159493 - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

Author: vgritsenko
Date: Wed Mar 30 09:39:21 2005
New Revision: 159493

URL: http://svn.apache.org/viewcvs?view=rev&rev=159493
Log:
Continue log config cleanup:
* Add license!
* Add console configuration
* Reflow text
* Use build.properties parameter for loglevel

Modified:
    cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

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=159492&r2=159493
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/logkit.xconf (original)
+++ cocoon/trunk/src/webapp/WEB-INF/logkit.xconf Wed Mar 30 09:39:21 2005
@@ -1,4 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  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.
+-->
 
 <!--+
     | This is the cocoon logkit configuration file.
@@ -13,20 +28,22 @@
     |
     |   http://wiki.apache.org/cocoon/ConfiguringTheLogs
     |
+    | $Id$
     +-->
-
 <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 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 type="cocoon" class="org.apache.cocoon.util.log.CocoonTargetFactory"/>
     <factory type="servlet" class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory"/>
+    <factory type="stream" class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
   </factories>
 
   <!--+
@@ -53,39 +70,43 @@
           | 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-->
+      <format type="cocoon">%5.5{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n</format>
+      <!--format type="cocoon">%5.5{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>
+      <append>false</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">
+      <rotation type="unique" pattern="yyyyMMdd" suffix=".log">
         <or>
           <size>100m</size>
           <time>24:00:00</time>
         </or>
-      </rotation-->
+      </rotation>
+          +-->
     </cocoon>
 
     <cocoon id="deprecation">
       <filename>${context-root}/WEB-INF/logs/deprecation.log</filename>
-      <format type="cocoon">%7.7{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n</format>
+      <format type="cocoon">%5.5{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n</format>
       <append>true</append>
     </cocoon>
 
     <servlet id="servlet">
-      <format type="extended">%7.7{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\n</format>
+      <format type="extended">%5.5{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\n</format>
     </servlet>
 
+    <stream id="console">
+      <stream>System.out</stream>
+      <format type="extended">%5.5{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\n</format>
+    </stream>
   </targets>
 
   <!--+
@@ -115,7 +136,7 @@
         | 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="">
+    <category log-level="@loglevel@" name="">
       <log-target id-ref="main"/>
     </category>
 
@@ -133,13 +154,17 @@
         | 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="ERROR" name="">
       <category log-level="DEBUG" name="sitemap">
         <log-target id-ref="servlet"/>
       </category>
+      <category log-level="INFO" name="access">
+        <log-target id-ref="console"/>
+      </category>
       <log-target id-ref="core"/>
-    </category-->
+    </category>
+        +-->
 
   </categories>
 



Re: svn commit: r159493 - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Carsten Ziegeler wrote:
> Leszek Gawron wrote:
> 
>>>With 2.2 we can make it configurable using properties; so you can
>>>overwrite the value on startup.
>>>
>>>Carsten
>>>
>>>
>>
>>how ? :)
>>
> 
> With Cocoon 2.2 you can provide a cocoon-settings.properties file in the
> context directory of Cocoon and specify any property in this file, like
> hello=world
> 
> Then you can use these properties throughout the cocoon.xconf and logkit
> configuration: ${hello}.
> 
> With the cocoon-settings.properties you provide the default value and
> via commandline you can override the values "-Dhello=cocoon".
> 
> [1] has a short description; I will write some config docs as soon as I
> have more time :(
> 
> Carsten
> 
> [1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110857478808645&w=2
That is a very nice feature. I really think we should start a multi user 
blog. It would be much easier for you to report that to the world. We 
could introduce some blog entry states like
- "to be documented"
- "ported to official docs"

Then you just put the blog post on the web and after sometime even 
someone else may just pick it up and put into official documentation.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Re: svn commit: r159493 - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

Posted by Carsten Ziegeler <cz...@apache.org>.
Leszek Gawron wrote:
>>
>>With 2.2 we can make it configurable using properties; so you can
>>overwrite the value on startup.
>>
>>Carsten
>>
>>
> 
> how ? :)
> 
With Cocoon 2.2 you can provide a cocoon-settings.properties file in the
context directory of Cocoon and specify any property in this file, like
hello=world

Then you can use these properties throughout the cocoon.xconf and logkit
configuration: ${hello}.

With the cocoon-settings.properties you provide the default value and
via commandline you can override the values "-Dhello=cocoon".

[1] has a short description; I will write some config docs as soon as I
have more time :(

Carsten

[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110857478808645&w=2

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r159493 - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Carsten Ziegeler wrote:
> Vadim Gritsenko wrote:
> 
>>Leszek Gawron wrote:
>>
>>
>>>vgritsenko@apache.org wrote:
>>>
>>>
>>>
>>>>-      <append>true</append>
>>>>+      <append>false</append>
>>>
>>>
>>>wouldn't it be better to append data by default?
>>
>>
>>No.
>>
>>For production config, you want append=true, and rotation (type=unique).
>>For development config, you want append=false, and no rotation.
>>
>>Previously it was neither. Now it's development.
>>
>>
>>
>>
>>>or at least make it 
>>>configurable during build just like log level?
>>
>>
>>I've got no problem with that, +1.
>>
> 
> With 2.2 we can make it configurable using properties; so you can
> overwrite the value on startup.
> 
> Carsten
> 
> 
how ? :)

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Re: svn commit: r159493 - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

Posted by Carsten Ziegeler <cz...@apache.org>.
Vadim Gritsenko wrote:
> Leszek Gawron wrote:
> 
>>vgritsenko@apache.org wrote:
>>
>>
>>>-      <append>true</append>
>>>+      <append>false</append>
>>
>>
>>wouldn't it be better to append data by default?
> 
> 
> No.
> 
> For production config, you want append=true, and rotation (type=unique).
> For development config, you want append=false, and no rotation.
> 
> Previously it was neither. Now it's development.
> 
> 
> 
>>or at least make it 
>>configurable during build just like log level?
> 
> 
> I've got no problem with that, +1.
> 
With 2.2 we can make it configurable using properties; so you can
overwrite the value on startup.

Carsten


-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r159493 - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Leszek Gawron wrote:
> vgritsenko@apache.org wrote:
> 
>> -      <append>true</append>
>> +      <append>false</append>
> 
> 
> wouldn't it be better to append data by default?

No.

For production config, you want append=true, and rotation (type=unique).
For development config, you want append=false, and no rotation.

Previously it was neither. Now it's development.


> or at least make it 
> configurable during build just like log level?

I've got no problem with that, +1.

Vadim

Re: svn commit: r159493 - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf

Posted by Leszek Gawron <lg...@apache.org>.
vgritsenko@apache.org wrote:
>    <!--+
> -      | 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 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 type="cocoon" class="org.apache.cocoon.util.log.CocoonTargetFactory"/>
>      <factory type="servlet" class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory"/>
> +    <factory type="stream" class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
>    </factories>
>  
>    <!--+
> @@ -53,39 +70,43 @@
>            | 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-->
> +      <format type="cocoon">%5.5{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n</format>
> +      <!--format type="cocoon">%5.5{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>
> +      <append>false</append>

wouldn't it be better to append data by default? or at least make it 
configurable during build just like log level?

-- 
Leszek Gawron                                                 MobileBox
lgawron@apache.org                              http://www.mobilebox.pl