Class LoggerLayoutXml

Description

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

Parameters: $locationInfo.

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:

  1. require_once dirname(__FILE__).'/../../main/php/Logger.php';
  2.  
  3. Logger::configure(dirname(__FILE__).'/../resources/layout_xml.properties');
  4. $logger Logger::getRootLogger();
  5. $logger->info("Hello World!");

  1. log4php.appender.default = LoggerAppenderEcho
  2. log4php.appender.default.layout = LoggerLayoutXml
  3. log4php.rootLogger = DEBUG, default

The above would print:
   
     
       
       
     
   

  • version: $Revision: 883108 $

Located in /layouts/LoggerLayoutXml.php (line 51)

LoggerLayout
   |
   --LoggerLayoutXml
Class Constant Summary
 CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA['
 CDATA_END = ']]>'
 CDATA_PSEUDO_END = ']]&gt;'
 CDATA_START = '<![CDATA['
 LOG4J_NS = 'http://jakarta.apache.org/log4j/'
 LOG4J_NS_PREFIX = 'log4j'
 LOG4PHP_NS = 'http://logging.apache.org/log4php/'
 LOG4PHP_NS_PREFIX = 'log4php'
Method Summary
void activateOptions ()
string format (LoggerLoggingEvent $event)
string getFooter ()
string getHeader ()
boolean getLocationInfo ()
boolean getLog4jNamespace ()
void setLocationInfo ( $flag)
void setLog4jNamespace (boolean $flag)
Methods
activateOptions (line 93)

No options to activate.

  • access: public
void activateOptions ()

Redefinition of:
LoggerLayout::activateOptions()
Activates options for this layout.
format (line 120)

Formats a LoggerLoggingEvent in conformance with the log4php.dtd.

  • access: public
string format (LoggerLoggingEvent $event)

Redefinition of:
LoggerLayout::format()
Override this method to create your own layout format.
getFooter (line 159)
  • access: public
string getFooter ()

Redefinition of:
LoggerLayout::getFooter()
Returns the footer for the layout format.
getHeader (line 106)
  • access: public
string getHeader ()

Redefinition of:
LoggerLayout::getHeader()
Returns the header for the layout format.
getLocationInfo (line 168)

Whether or not file name and line number will be included in the output.

  • access: public
boolean getLocationInfo ()
getLog4jNamespace (line 186)
  • access: public
boolean getLog4jNamespace ()
setLocationInfo (line 179)

The $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.

  • access: public
void setLocationInfo ( $flag)
  • $flag
setLog4jNamespace (line 193)
  • access: public
void setLog4jNamespace (boolean $flag)
  • boolean $flag

Inherited Methods

Inherited From LoggerLayout

LoggerLayout::activateOptions()
LoggerLayout::format()
LoggerLayout::getContentType()
LoggerLayout::getFooter()
LoggerLayout::getHeader()
Class Constants
CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA[' (line 62)
CDATA_END = ']]>' (line 59)
CDATA_PSEUDO_END = ']]&gt;' (line 60)
CDATA_START = '<![CDATA[' (line 58)
LOG4J_NS = 'http://jakarta.apache.org/log4j/' (line 53)
LOG4J_NS_PREFIX = 'log4j' (line 52)
LOG4PHP_NS = 'http://logging.apache.org/log4php/' (line 56)
LOG4PHP_NS_PREFIX = 'log4php' (line 55)

Documentation generated on Fri, 27 Nov 2009 07:44:50 +0100 by phpDocumentor 1.4.3