Class LoggerLayoutHtml

Description

This layout outputs events in a HTML table.

Configurable parameters for this layout are:

  • title
  • locationInfo
An example for this layout:

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

The corresponding XML file:

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

The above will print a HTML table that looks, converted back to plain text, like the following:

    Log session start time Wed Sep 9 00:11:30 2009

    Time Thread Level Category   Message
    0    8318   INFO  root       Hello World!

  • version: $Revision: 1213283 $

Located in /layouts/LoggerLayoutHtml.php (line 49)

LoggerConfigurable
   |
   --LoggerLayout
      |
      --LoggerLayoutHtml
Variable Summary
boolean $locationInfo
string $title
Method Summary
string format (LoggerLoggingEvent $event)
string getContentType ()
string getFooter ()
string getHeader ()
void getLocationInfo ()
string getTitle ()
void setLocationInfo ( $flag)
void setTitle ( $title)
Variables
boolean $locationInfo = false (line 62)

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.

<p>If you are embedding this layout within a LoggerAppenderMail or a LoggerAppenderMailEvent then make sure to set the LocationInfo option of that appender as well.

  • access: protected
string $title = "Log4php Log Messages" (line 70)

The Title option takes a String value. This option sets the document title of the generated HTML document.

Defaults to 'Log4php Log Messages'.

  • access: protected
Methods
format (line 121)
  • access: public
string format (LoggerLoggingEvent $event)

Redefinition of:
LoggerLayout::format()
Override this method to create your own layout format.
getContentType (line 113)
  • return: Returns the content type output by this layout, i.e "text/html".
  • access: public
string getContentType ()

Redefinition of:
LoggerLayout::getContentType()
Returns the content type output by this layout.
getFooter (line 207)
  • return: Returns the appropriate HTML footers.
  • access: public
string getFooter ()

Redefinition of:
LoggerLayout::getFooter()
Returns the footer for the layout format.
getHeader (line 173)
  • return: Returns appropriate HTML headers.
  • access: public
string getHeader ()

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

Returns the current value of the LocationInfo option.

  • access: public
void getLocationInfo ()
getTitle (line 106)
  • return: Returns the current value of the Title option.
  • access: public
string getTitle ()
setLocationInfo (line 83)

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.

<p>If you are embedding this layout within a LoggerAppenderMail or a LoggerAppenderMailEvent then make sure to set the LocationInfo option of that appender as well.

  • access: public
void setLocationInfo ( $flag)
  • $flag
setTitle (line 99)

The Title option takes a String value. This option sets the document title of the generated HTML document.

Defaults to 'Log4php Log Messages'.

  • access: public
void setTitle ( $title)
  • $title

Inherited Methods

Inherited From LoggerLayout

LoggerLayout::activateOptions()
LoggerLayout::format()
LoggerLayout::getContentType()
LoggerLayout::getFooter()
LoggerLayout::getHeader()
LoggerLayout::warn()

Inherited From LoggerConfigurable

LoggerConfigurable::setBoolean()
LoggerConfigurable::setFileSize()
LoggerConfigurable::setInteger()
LoggerConfigurable::setLevel()
LoggerConfigurable::setNumeric()
LoggerConfigurable::setPositiveInteger()
LoggerConfigurable::setString()
LoggerConfigurable::warn()

Documentation generated on Sat, 18 Feb 2012 22:32:24 +0000 by phpDocumentor 1.4.3