# Class LoggerLayoutXml

The output of the LoggerXmlLayout consists of a series of log4php:event elements.

Configurable parameters:

- `LoggerLayoutXml::$locationInfo` - If set to true then the file name and line number of the origin of the log statement will be included in output.
- `LoggerLayoutXml::$log4jNamespace` - If set to true then log4j namespace will be used instead of log4php namespace. This can be usefull when using log viewers which can only parse the log4j namespace such as Apache Chainsaw.

It does not output a complete well-formed XML file. The output is designed to be included as an external entity in a separate file to form a correct XML file.

Example:

{@example ../../examples/php/layout_xml.php 19}

{@example ../../examples/resources/layout_xml.properties 18}

The above would print:

    <log4php:eventSet xmlns:log4php="http://logging.apache.org/log4php/" version="0.3" includesLocationInfo="true">
            <log4php:event logger="root" level="INFO" thread="13802" timestamp="1252456226491">
                    <log4php:message><![CDATA[Hello World!]]></log4php:message>
                    <log4php:locationInfo class="main" file="examples/php/layout_xml.php" line="6" method="main" />
            </log4php:event>
    </log4php:eventSet>

  LoggerConfigurable
  LoggerLayout
  LoggerLayoutXml

Package: log4php\layouts
Version: $Revision: 1213283 $
Located at layouts/LoggerLayoutXml.php

Methods summary
`public` | # `activateOptions( )` Activates options for this layout. Override this method if you have options to be activated. Activates options for this layout. Override this method if you have options to be activated.

#### Overrides

`LoggerLayout::activateOptions()`
`public string` | # `getHeader( )`

#### Returns

`string`

#### Overrides

`LoggerLayout::getHeader()`
`public string` | # `format( `LoggerLoggingEvent` $event )` Formats a `LoggerLoggingEvent` in conformance with the log4php.dtd. Formats a `LoggerLoggingEvent` in conformance with the log4php.dtd.

#### Parameters

$event
  ``LoggerLoggingEvent``
  $event

#### Returns

`string`

#### Overrides

`LoggerLayout::format()`
`public string` | # `getFooter( )`

#### Returns

`string`

#### Overrides

`LoggerLayout::getFooter()`
`public boolean` | # `getLocationInfo( )` Whether or not file name and line number will be included in the output. Whether or not file name and line number will be included in the output.

#### Returns

`boolean`
`public` | # `setLocationInfo( mixed $flag )` The `LoggerLayoutXml::$locationInfo` option takes a boolean value. By default, it is set to false which means there will be no location information output by this layout. If the the option is set to true, then the file name and line number of the statement at the origin of the log statement will be output.

The `LoggerLayoutXml::$locationInfo` option takes a boolean value. By default, it is set to false which means there will be no location information output by this layout. If the the option is set to true, then the file name and line number of the statement at the origin of the log statement will be output.

`public boolean` | # `getLog4jNamespace( )`

#### Returns

`boolean`
`public` | # `setLog4jNamespace( boolean $flag )`

#### Parameters

$flag
  `boolean`

Methods inherited from LoggerLayout
`getContentType(), warn()`

Methods inherited from LoggerConfigurable
`setBoolean(), setFileSize(), setInteger(), setLevel(), setNumeric(), setPositiveInteger(), setString()`

Constants summary
`string` | `LOG4J_NS_PREFIX` | `'log4j'` | #
`string` | `LOG4J_NS` | `'http://jakarta.apache.org/log4j/'` | #
`string` | `LOG4PHP_NS_PREFIX` | `'log4php'` | #
`string` | `LOG4PHP_NS` | `'http://logging.apache.org/log4php/'` | #
`string` | `CDATA_START` | `'<![CDATA['` | #
`string` | `CDATA_END` | `']]>'` | #
`string` | `CDATA_PSEUDO_END` | `']]&gt;'` | #
`string` | `CDATA_EMBEDDED_END` | `']]>]]&gt;<![CDATA['` | #

Properties summary
`protected boolean` | $locationInfo | `true` | # If set to true then the file name and line number of the origin of the log statement will be output. If set to true then the file name and line number of the origin of the log statement will be output.
`protected boolean` | $log4jNamespace | `false` | # If set to true, log4j namespace will be used instead of the log4php namespace. If set to true, log4j namespace will be used instead of the log4php namespace.
`protected string` | $namespace | ``LoggerLayoutXml::LOG4PHP_NS`` | # The namespace in use. The namespace in use.
`protected string` | $namespacePrefix | ``LoggerLayoutXml::LOG4PHP_NS_PREFIX`` | # The namespace prefix in use The namespace prefix in use