This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).
*Design, strategies and part of the methods documentation are developed by log4j team * (Ceki Gülcü as log4j project founder and * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).
* *PHP port, extensions and modifications by VxR. All rights reserved.
* For more information, please see {@link http://www.vxr.it/log4php/}.
This software is published under the terms of the LGPL License * a copy of which has been included with this distribution in the LICENSE file.
* * @package log4php * @subpackage layouts */ /** * @ignore */ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..'); if (!defined('LOG4PHP_LINE_SEP')) { if (substr(php_uname(), 0, 7) == "Windows") { /** * @ignore */ define('LOG4PHP_LINE_SEP', "\r\n"); } else { /** * @ignore */ define('LOG4PHP_LINE_SEP', "\n"); } } /** */ require_once(LOG4PHP_DIR . '/LoggerLayout.php'); require_once(LOG4PHP_DIR . '/spi/LoggerLoggingEvent.php'); /** * This layout outputs events in a HTML table. * * Parameters are: {@link $title}, {@link $locationInfo}. * * @author VxRIf you are embedding this layout within a {@link LoggerAppenderMail} * or a {@link LoggerAppenderMailEvent} then make sure to set the * LocationInfo option of that appender as well. * @var boolean */ var $locationInfo = false; /** * The Title option takes a String value. This option sets the * document title of the generated HTML document. * Defaults to 'Log4php Log Messages'. * @var string */ var $title = "Log4php Log Messages"; /** * Constructor */ function LoggerLayoutHtml() { return; } /** * 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. * *
If you are embedding this layout within a {@link LoggerAppenderMail} * or a {@link LoggerAppenderMailEvent} then make sure to set the * LocationInfo option of that appender as well. */ function setLocationInfo($flag) { if (is_bool($flag)) { $this->locationInfo = $flag; } else { $this->locationInfo = (bool)(strtolower($flag) == 'true'); } } /** * Returns the current value of the LocationInfo option. */ function getLocationInfo() { return $this->locationInfo; } /** * The Title option takes a String value. This option sets the * document title of the generated HTML document. * Defaults to 'Log4php Log Messages'. */ function setTitle($title) { $this->title = $title; } /** * @return string Returns the current value of the Title option. */ function getTitle() { return $this->title; } /** * @return string Returns the content type output by this layout, i.e "text/html". */ function getContentType() { return "text/html"; } /** * No options to activate. */ function activateOptions() { return true; } /** * @param LoggerLoggingEvent $event * @return string */ function format($event) { $sbuf = LOG4PHP_LINE_SEP . "
Time | " . LOG4PHP_LINE_SEP; $sbuf .= "Thread | " . LOG4PHP_LINE_SEP; $sbuf .= "Level | " . LOG4PHP_LINE_SEP; $sbuf .= "Category | " . LOG4PHP_LINE_SEP; if ($this->locationInfo) $sbuf .= "File:Line | " . LOG4PHP_LINE_SEP; $sbuf .= "Message | " . LOG4PHP_LINE_SEP; $sbuf .= "
---|