Author: grobmeier
Date: Mon Aug 31 07:09:46 2009
New Revision: 809479

URL: http://svn.apache.org/viewvc?rev=809479&view=rev
Log:
added renderer docs

Added:
    incubator/log4php/trunk/src/site/apt/docs/renderer.apt
Modified:
    incubator/log4php/trunk/src/site/site.xml

Added: incubator/log4php/trunk/src/site/apt/docs/renderer.apt
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/site/apt/docs/renderer.apt?rev=809479&view=auto
==============================================================================
--- incubator/log4php/trunk/src/site/apt/docs/renderer.apt (added)
+++ incubator/log4php/trunk/src/site/apt/docs/renderer.apt Mon Aug 31 07:09:46 
2009
@@ -0,0 +1,70 @@
+~~ Licensed to the Apache Software Foundation (ASF) under one or more
+~~ contributor license agreements.  See the NOTICE file distributed with
+~~ this work for additional information regarding copyright ownership.
+~~ The ASF licenses this file to You 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.
+ ------
+ Apache log4php Renderer
+ ------
+ ------
+ ------
+
+Apache Log4php Renderer
+
+  Just as importantly, log4php will render the content of the log message 
according
+  to user specified criteria. For example, if you frequently need to log 
Oranges,
+  an object type used in your current project, then you can register an 
OrangeRenderer
+  that will be invoked whenever an orange needs to be logged.
+
+  Object rendering follows the class hierarchy. For example, assuming oranges 
are fruits,
+  if you register an FruitRenderer, all fruits including oranges will be 
rendered
+  by the FruitRenderer, unless of course you registered an orange specific 
OrangeRenderer.
+
+  Object renderers have to implement the LoggerRendererObject interface.
+  
+  For example, this is a class from your app you want to render in a log 
message:
+  
++--
+class Fruit {
+    public $test1 = 'test1';
+    public $test2 = 'test2';
+    public $test3 = 'test3';
+}
++--
+
+  You'll need to write a FruitRenderer, implementing the LoggerRendererObject 
interface.
+
++--
+class FruitRenderer3 implements LoggerRendererObject {
+    public function render($o) {
+               return $o->test1.','.$o->test2.','.$o->test3;
+       }
+}
++--
+
+  After that, you have to configure it in Log4PHP. This can be done via 
properties file
+  and via XML file.
+  
+  Via Properties:
+  
++--
+log4php.renderer.Fruit=FruitRenderer
++--
+
+  Via XML:
+
++--
+<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/";>
+       <renderer renderedClass="Fruit2" renderingClass="FruitRenderer2" />
+    <appender threshold="WARN" name="default" class="LoggerAppenderEcho">
+    ...
++--

Modified: incubator/log4php/trunk/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/site/site.xml?rev=809479&r1=809478&r2=809479&view=diff
==============================================================================
--- incubator/log4php/trunk/src/site/site.xml (original)
+++ incubator/log4php/trunk/src/site/site.xml Mon Aug 31 07:09:46 2009
@@ -55,14 +55,8 @@
                        <item name="Appender" href="/docs/appenders.html"/>
                        <item name="Threshold" 
href="/docs/appender-threshold.html"/>
                        <item name="Filter" href="/docs/appender-filter.html"/>
+                       <item name="Renderer" href="/docs/renderer.html"/> 
                        <item name="Performance" href="/docs/performance.html"/>
-            <!--
-                
-                   
-                   <item name="Appender Filter" 
href="/docs/appenders-filter.html"/>
-                   <item name="Layout" href="/docs/layout.html"/>
-                   <item name="Renderer" href="/docs/renderer.html"/> 
-            -->
         </menu>
         
         <menu name="Community">


Reply via email to