~~ 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 Log4php can not only log string messages but also objects which will be converted to strings using either the default renderer or a customized render class. Example: %{snippet|id=doxia|file=src/examples/php/renderer_map.php} %{snippet|id=doxia|file=src/examples/resources/renderer_map.properties} Will output the following (notice how $person shows up in the output): +-- DEBUG - Now comes the current MyClass object: DEBUG - Doe, John +-- or the following if the default renderer were used: +-- DEBUG - Now comes the current MyClass object: DEBUG - Person::__set_state(array( 'firstName' => 'John', 'lastName' => 'Doe', )) +-- 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. The XML configuration would look like this: +-- ... +--