예제 #1
0
 /**
  * コンストラクタ
  *
  * @param Layout Layoutインスタンス
  * @param string $to メール宛先アドレス
  * @param string $subject メール件名
  * @param string $from メール差出人アドレス
  * @access public
  * @since  2.0
  */
 function &SMTPAppender($layout, $to, $from = null, $subject = SMTP_APPENDER_SUBJECT)
 {
     parent::Appender($layout);
     $this->to = $to;
     $this->subject = $subject;
     $this->from = $from;
 }
예제 #2
0
 /**
  * Create a new FileAppender instance.
  *
  * <br/><br/>
  *
  * Conversion characters:
  *
  * <ul>
  *     <li><b>%C{constant}</b> - the value of a PHP constant</li>
  *     <li><b>%d{format}</b>   - a date (uses date() format)</li>
  * </ul>
  *
  * @param Layout A Layout instance.
  * @param string An absolute file-system path to the log file.
  * @param bool   Whether or not the file pointer should be opened in
  *               appending mode (if false, all data is truncated).
  *
  * @access public
  * @since  2.0
  */
 function FileAppender($layout, $file, $append = TRUE)
 {
     parent::Appender($layout);
     $this->append = $append;
     $this->file = $file;
     $this->pattern =& new ConversionPattern($file);
     $this->openFP();
 }
예제 #3
0
 /**
  * Short description of method log
  *
  * @access public
  * @author Joel Bout, <*****@*****.**>
  * @param
  *            int level
  * @param
  *            string message
  * @param
  *            array tags
  * @param
  *            string errorFile
  * @param
  *            int errorLine
  * @return mixed
  */
 public function log($level, $message, $tags, $errorFile = '', $errorLine = 0)
 {
     // section 127-0-1-1--5509896f:133feddcac3:-8000:000000000000432A begin
     if ($this->enabled && $this->implementor->getLogThreshold() <= $level) {
         $this->disable();
         $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
         array_shift($stack);
         // retrieving the user can be a complex procedure, leading to missing log informations
         $user = null;
         if ($errorFile == '') {
             $keys = array_keys($stack);
             $current = $stack[$keys[0]];
             if (isset($current['file']) && isset($current['line'])) {
                 $errorFile = $current['file'];
                 $errorLine = $current['line'];
             }
         }
         if (PHP_SAPI != 'cli') {
             $requestURI = $_SERVER['REQUEST_URI'];
         } else {
             $requestURI = implode(' ', $_SERVER['argv']);
         }
         // reformat input
         if (is_object($message) || is_array($message)) {
             $message = print_r($message, true);
         } else {
             $message = (string) $message;
         }
         if (is_string($tags)) {
             $tags = array($tags);
         }
         $this->implementor->log(new Log\Item($message, $level, time(), $stack, $tags, $requestURI, $errorFile, $errorLine));
         $this->restore();
     }
     // section 127-0-1-1--5509896f:133feddcac3:-8000:000000000000432A end
 }
 /**
  * Remove the specified appender from the given log categories. For usage
  * of log category flags, see addAppender().
  * 
  * @param   util.log.Appender appender
  * @param   int flag default LogLevel::ALL
  */
 public function removeAppender(Appender $appender, $flag = LogLevel::ALL)
 {
     foreach ($this->_appenders as $f => $appenders) {
         if (!($f & $flag)) {
             continue;
         }
         unset($this->_appenders[$f][$appender->hashCode()]);
         // Last appender for this flag removed - remove flag alltogether
         if (0 === sizeof($this->_appenders[$f])) {
             unset($this->_appenders[$f]);
         }
     }
 }
 /**
  * Create a new FileAppender instance.
  *
  * @param Layout A Layout instance.
  *
  * @access public
  * @since  1.0
  */
 function StdoutAppender($layout, $properties)
 {
     parent::Appender($layout, $properties);
 }
예제 #6
0
 /**
  * Create a new FileAppender instance.
  *
  * @param Layout A Layout instance.
  *
  * @access public
  * @since  2.0
  */
 function StdoutAppender($layout)
 {
     parent::Appender($layout);
 }
 /**
  * Create a new qFileAppender instance.
  *
  *
  * @param Layout A Layout instance.
  * @param properties An associative array with properties that might be needed by this
  * appender
  * @access public
  * @since  1.0
  * @see qAppender
  */
 function FileAppender($layout, $properties)
 {
     parent::Appender($layout, $properties);
     $this->file = $properties["file"];
     $this->openFP();
 }
예제 #8
0
 /**
  * Short description of method addAppender
  *
  * @access public
  * @author Joel Bout, <*****@*****.**>
  * @param  Appender appender
  * @return mixed
  */
 public function addAppender(Appender $appender)
 {
     // section 127-0-1-1--13fe8a1d:134184f8bc0:-8000:0000000000001820 begin
     $this->appenders[] = $appender;
     if (is_null($this->minLevel) || $this->minLevel > $appender->getLogThreshold()) {
         $this->minLevel = $appender->getLogThreshold();
     }
     // section 127-0-1-1--13fe8a1d:134184f8bc0:-8000:0000000000001820 end
 }