Example #1
0
 /**
  * Set maximum depth of this diagnostic context. If the current
  * depth is smaller or equal to <var>maxDepth</var>, then no
  * action is taken.
  *
  * <p>This method is a convenient alternative to multiple 
  * {@link pop()} calls. Moreover, it is often the case that at 
  * the end of complex call sequences, the depth of the NDC is
  * unpredictable. The {@link setMaxDepth()} method circumvents
  * this problem.
  *
  * @param integer $maxDepth
  * @see getDepth()
  * @static
  */
 public static function setMaxDepth($maxDepth)
 {
     $maxDepth = (int) $maxDepth;
     if (Ideasa_Log4php_LoggerNDC::getDepth() > $maxDepth) {
         self::$stack = array_slice(self::$stack, 0, $maxDepth);
     }
 }
 /**
  * This method returns the NDC for this event. It will return the
  * correct content even if the event was generated in a different
  * thread or even on a different machine. The {@link Ideasa_Log4php_LoggerNDC::get()} method
  * should <b>never</b> be called directly.
  * @return string  
  */
 public function getNDC()
 {
     if ($this->ndcLookupRequired) {
         $this->ndcLookupRequired = false;
         $this->ndc = Ideasa_Log4php_LoggerNDC::get();
     }
     return $this->ndc;
 }