src/Log/AggregateLogger.php
public function log($level, $message, array $context = []) {
        $levelPriority = self::levelPriority($level);
        if ($levelPriority > LOG_DEBUG) {
            throw new \Psr\Log\InvalidArgumentException("Invalid log level: $level.");
        }

        // Prevent an infinite cycle by setting an internal flag.
        static $inCall = false;
        if ($inCall) {
            return;
        }
        $inCall = true;

        foreach ($this->loggers as $logger) {
            /* @var LoggerInterface $logger */
            if (!$logger['enabled']) {
                continue;
            }

            if ($logger['priority'] >= $levelPriority) {
                try {
                    $logger['logger']->log($level, $message, $context);
                } catch (\Exception $ex) {
                    $inCall = false;
                    throw $ex;
                }
            }
        }

        $inCall = false;
    }
public function log($level, $message, array $context = []) {
        $levelPriority = self::levelPriority($level);
        if ($levelPriority > LOG_DEBUG) {
            throw new \Psr\Log\InvalidArgumentException("Invalid log level: $level.");
        }

        // Prevent an infinite cycle by setting an internal flag.
        static $inCall = false;
        if ($inCall) {
            return;
        }
        $inCall = true;

        foreach ($this->loggers as $logger) {
            /* @var LoggerInterface $logger */
            if (!$logger['enabled']) {
                continue;
            }

            if ($logger['priority'] >= $levelPriority) {
                try {
                    $logger['logger']->log($level, $message, $context);
                } catch (\Exception $ex) {
                    $inCall = false;
                    throw $ex;
                }
            }
        }

        $inCall = false;
    }
public function log ( $ level , $ message , array $ context = [ ] ) { $ levelPriority = self :: levelPriority ( $ level ) ; if ( $ levelPriority > LOG_DEBUG ) { throw new \ Psr \ Log \ InvalidArgumentException ( "Invalid log level: $level." ) ; } // Prevent an infinite cycle by setting an internal flag. static $ inCall = false ; if ( $ inCall ) { return ; } $ inCall = true ; foreach ( $ this -> loggers as $ logger ) { /* @var LoggerInterface $logger */ if ( ! $ logger [ 'enabled' ] ) { continue ; } if ( $ logger [ 'priority' ] >= $ levelPriority ) { try { $ logger [ 'logger' ] -> log ( $ level , $ message , $ context ) ; } catch ( \ Exception $ ex ) { $ inCall = false ; throw $ ex ; } } } $ inCall = false ; }
Log with an arbitrary level.

@param mixed $level
@param string $message
@param array $context
Log with an arbitrary level .