LoggerAppenderEcho

LoggerAppenderEcho writes logging events using PHP's echo() function. Echo outputs may be buffered.

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
htmlLineBreaks boolean No false If set to true, a <br /> element will be inserted before each line break in the logged message.

Examples

This example shows how to configure LoggerAppenderEcho using the TTCC layout with htmlLineBreaks turned on.

  • XML
  • PHP
<configuration xmlns="http://logging.apache.org/log4php/">
    <appender name="default" class="LoggerAppenderEcho">
        <layout class="LoggerLayoutSimple" />
        <param name="htmlLineBreaks" value="true" />
    </appender>
    <root>
        <appender_ref ref="default" />
    </root>
</configuration>
array(
    'appenders' => array(
        'default' => array(
            'class' => 'LoggerAppenderEcho',
            'layout' => array(
                'class' => 'LoggerLayoutSimple',
            ),
            'params' => array(
                'htmlLineBreaks' => 'true',
            ),
        ),
    ),
    'rootLogger' => array(
        'appenders' => array('default'),
    ),
);