public function log(
              $type,
              $message,
        array $context = [],
              $time = null,
              $fingerprint = null,
              $separator = null
    ) {
        // call parents log just as normal => so content, raw ... gets filled
        parent::log($type, $message, $context, $time, $fingerprint, $separator);

        // log date time
        $time = ($time !== null) ?
            $time :
            $this->date.' ['.$this->dateTime->getMicrotimeDiff($_SERVER['REQUEST_TIME']).']';

        // Store message in archive for e.g. debug bar and similar outputs
        $this->archive(
            sha1($message.$type.$fingerprint),
            [
                'type'        => $type,
                'message'     => $message,
                'context'     => $context,
                'time'        => $time,
                'fingerprint' => $fingerprint,
                'separator'   => $separator,
            ]
        );

        // and now the tricky hook -> notify all observers about the log-event
        $this->notify('log');

        // return always success
        return true;
    }
public function log(
              $type,
              $message,
        array $context = [],
              $time = null,
              $fingerprint = null,
              $separator = null
    ) {
        // call parents log just as normal => so content, raw ... gets filled
        parent::log($type, $message, $context, $time, $fingerprint, $separator);

        // log date time
        $time = ($time !== null) ?
            $time :
            $this->date.' ['.$this->dateTime->getMicrotimeDiff($_SERVER['REQUEST_TIME']).']';

        // Store message in archive for e.g. debug bar and similar outputs
        $this->archive(
            sha1($message.$type.$fingerprint),
            [
                'type'        => $type,
                'message'     => $message,
                'context'     => $context,
                'time'        => $time,
                'fingerprint' => $fingerprint,
                'separator'   => $separator,
            ]
        );

        // and now the tricky hook -> notify all observers about the log-event
        $this->notify('log');

        // return always success
        return true;
    }
public function log ( $ type , $ message , array $ context = [ ] , $ time = null , $ fingerprint = null , $ separator = null ) { // call parents log just as normal => so content, raw ... gets filled parent :: log ( $ type , $ message , $ context , $ time , $ fingerprint , $ separator ) ; // log date time $ time = ( $ time !== null ) ? $ time : $ this -> date . ' [' . $ this -> dateTime -> getMicrotimeDiff ( $ _SERVER [ 'REQUEST_TIME' ] ) . ']' ; // Store message in archive for e.g. debug bar and similar outputs $ this -> archive ( sha1 ( $ message . $ type . $ fingerprint ) , [ 'type' => $ type , 'message' => $ message , 'context' => $ context , 'time' => $ time , 'fingerprint' => $ fingerprint , 'separator' => $ separator , ] ) ; // and now the tricky hook -> notify all observers about the log-event $ this -> notify ( 'log' ) ; // return always success return true ; }
Dispatches a passed message and all arguments to attached loggers.

@param string $type        The level/type of the log entry
@param string $message     The message to log
@param array  $context     The context with variables used for interpolation
@param string $time        The time to use for logging
@param string $fingerprint The fingerprint to use/set
@param string $separator   The separator to use/set

@author Benjamin Carl <opensource@clickalicious.de>

@return bool TRUE on success, otherwise FALSE
Dispatches a passed message and all arguments to attached loggers .