123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
- require_once(LOG4PHP_DIR . '/LoggerAppenderSkeleton.php');
- require_once(LOG4PHP_DIR . '/LoggerLog.php');
- class LoggerAppenderEcho extends LoggerAppenderSkeleton {
-
- var $requiresLayout = true;
-
- var $firstAppend = true;
-
-
- function LoggerAppenderEcho($name)
- {
- $this->LoggerAppenderSkeleton($name);
- }
- function activateOptions()
- {
- return;
- }
-
- function close()
- {
- if (!$this->firstAppend)
- echo $this->layout->getFooter();
- $this->closed = true;
- }
- function append($event)
- {
- LoggerLog::debug("LoggerAppenderEcho::append()");
-
- if ($this->layout !== null) {
- if ($this->firstAppend) {
- echo $this->layout->getHeader();
- $this->firstAppend = false;
- }
- echo $this->layout->format($event);
- }
- flush();
- }
- }
- ?>
|