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
Version: $Revision: 1213283 $
Located at core/log4php/layouts/LoggerLayoutXml.php
public
|
#
activateOptions( )
Activates options for this layout. Override this method if you have options to be activated. |
public
string
|
|
public
string
|
#
format(
Formats a |
public
string
|
|
public
boolean
|
|
public
|
#
setLocationInfo( $flag )
The |
public
boolean
|
|
public
|
getContentType(),
warn()
|
setBoolean(),
setFileSize(),
setInteger(),
setLevel(),
setNumeric(),
setPositiveInteger(),
setString()
|
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
|
#
']]>'
|
string |
CDATA_EMBEDDED_END
|
#
']]>]]><![CDATA['
|
protected
boolean
|
$locationInfo
If set to true then the file name and line number of the origin of the log statement will be output. |
#
true
|
protected
boolean
|
$log4jNamespace
If set to true, log4j namespace will be used instead of the log4php namespace. |
#
false
|
protected
string
|
$namespace
The namespace in use. |
|
protected
string
|
$namespacePrefix
The namespace prefix in use |