LoggerAppenderConsole

LoggerAppenderConsole writes logging events to the php://stdout or the php://stderr stream, the former being the default target.

Layout

This appender requires a layout. If no layout is specified in configuration, LoggerLayoutSimple will be used by default.

Parameters

The following parameters are available:

Parameter Type Required Default Description
target string No stdout The stream to write to; either "stdout" or "stderr".

Examples

This example shows how to configure LoggerAppenderConsole.

  1. <configuration xmlns="http://logging.apache.org/log4php/">
  2. <appender name="default" class="LoggerAppenderConsole">
  3. <layout class="LoggerLayoutSimple" />
  4. </appender>
  5. <root>
  6. <appender_ref ref="default" />
  7. </root>
  8. </configuration>
  1. array(
  2. 'appenders' => array(
  3. 'default' => array(
  4. 'class' => 'LoggerAppenderConsole',
  5. 'layout' => array(
  6. 'class' => 'LoggerLayoutSimple',
  7. ),
  8. ),
  9. ),
  10. 'rootLogger' => array(
  11. 'appenders' => array('default'),
  12. ),
  13. );