예제 #1
0
 /**
  * Retrieve the track ID we should use for logging. It is used to avoid infinite recursion between the logger class
  * and the session class.
  *
  * @return string The track ID we should use for logging, or 'NA' if we detect recursion.
  */
 private static function getTrackId()
 {
     if (self::$trackid === self::$TRACKID_FETCHING) {
         // recursion detected!
         return 'NA';
     }
     if (self::$trackid === NULL) {
         // no track ID yet, fetch it from the session class
         // mark it as currently being fetched
         self::$trackid = self::$TRACKID_FETCHING;
         // get the current session. This could cause recursion back to the logger class
         $session = SimpleSAML_Session::getSessionFromRequest();
         // update the track ID
         self::$trackid = $session->getTrackID();
     }
     assert('is_string(self::$trackid)');
     return self::$trackid;
 }
예제 #2
0
파일: Logger.php 프로젝트: filonuse/fedlab
 /**
  * Retrieve the trackid we should use for logging.
  *
  * It is used to avoid infinite recursion between the logger class and the session class.
  *
  * @return The trackid we should use for logging, or 'NA' if we detect recursion.
  */
 private static function getTrackId()
 {
     if (self::$trackid === self::$TRACKID_FETCHING) {
         /* Recursion detected. */
         return 'NA';
     }
     if (self::$trackid === NULL) {
         /* No trackid yet, fetch it from the session class. */
         /* Mark it as currently being fetched. */
         self::$trackid = self::$TRACKID_FETCHING;
         /* Get the current session. This could cause recursion back to the logger class. */
         $session = SimpleSAML_Session::getInstance();
         /* Update the trackid. */
         self::$trackid = $session->getTrackId();
     }
     assert('is_string(self::$trackid)');
     return self::$trackid;
 }
예제 #3
0
 /**
  * Flush any pending log messages to the logging handler.
  *
  * This method is intended to be registered as a shutdown handler, so that any pending messages that weren't sent
  * to the logging handler at that point, can still make it. It is therefore not intended to be called manually.
  *
  */
 public static function flush()
 {
     $s = SimpleSAML_Session::getSessionFromRequest();
     self::$trackid = $s->getTrackID();
     self::$shuttingDown = true;
     foreach (self::$earlyLog as $msg) {
         self::log($msg['level'], $msg['string'], $msg['statsLog']);
     }
 }