Push the log message and context information into Mongo

@param string $level Logging level (ex. info, debug, notice...)
@param string $message Log message
@param array $context Extra context information
@return boolean Success/fail of logging
768048
public function log($level, $message, array $context = array())
    {
        $logger = new \Monolog\Logger('audit');
        try {
            $handler = new \Monolog\Handler\MongoDBHandler(
                new \Mongo($this->getConnectString()),
                $this->getDbName(),
                $this->getDbCollection()
            );
        } catch (\MongoConnectionException $e) {
            throw new \Exception('Cannot connect to Mongo - please check your server');
        }
        $logger->pushHandler($handler);
        $logger->pushProcessor(function ($record) {
            $record['datetime'] = $record['datetime']->format('U');
            return $record;
        });

        return $logger->$level($message, $context);
    }
805148
public function log($level, $message, array $context = array())
    {
        if ($this->logLevels[$this->logLevelThreshold] < $this->logLevels[$level]) {
            return;
        }
        $message = $this->formatMessage($level, $message, $context);
        $this->write($message);
    }
125940
public function log($level, $message, array $context = [])
    {
        $messageToLog = $this->interpolate($message, $context);
        switch ($level) {
            case PsrLogLevel::EMERGENCY:
                Yii::error($messageToLog);
                break;
            case PsrLogLevel::ALERT:
                Yii::error($messageToLog);
                break;
            case PsrLogLevel::CRITICAL:
                Yii::error($messageToLog);
                break;
            case PsrLogLevel::ERROR:
                Yii::error($messageToLog);
                break;
            case PsrLogLevel::WARNING:
                Yii::warning($messageToLog);
                break;
            case PsrLogLevel::NOTICE:
                Yii::info($messageToLog);
                break;
            case PsrLogLevel::INFO:
                Yii::info($messageToLog);
                break;
            case PsrLogLevel::DEBUG:
                Yii::trace($messageToLog);
                break;
            default:
                throw new \Psr\Log\InvalidArgumentException(
                    'Unknown log level: ' . var_export($level, true),
                    1493998846
                );
        }
    }
58064
private function log($level, $message, array $context = array())
    {
        if (isset($this->logger)) {
            $this->logger->log($level, $message, $context);
        }
    }
54599
public function log($level, $message, array $context = []) {
		if (!Logger::check($level)) {
			return;
		}
		if (count($context) > 0) {
			foreach ($context as $k => $v) {
				$message = str_replace('{' . $k . '}', $v, $message);
			}
		}
		$content = sprintf("%s | %s | %s | %s", date('Y-m-d H:i:s'), $this->getLevel($level), microtime(true), $message);
		co::fwrite($this->handler, $content);
	}
1084317
public function log($level, $message, array $context = array())
    {
        $errorLevel = isset(self::$map[$level]) ? self::$map[$level] : common_Logger::ERROR_LEVEL;
        $this->logger->log($errorLevel, $message, $context);
    }
411155
public function log($level, $message, array $context = array())
    {
        if (!$this->fileName) {
            return;
        }
        file_put_contents($this->fileName, '['.$level.'] - '.$message.' | '.serialize($context));
    }
449277
public function log($level, $message, array $context = array()) {
		$result = preg_match(sprintf("/%s/%s", preg_quote($this->pattern, '/'), $this->modifiers), $message);
		if(!$result !== $this->negate) {
			$this->logger()->log($level, $message, $context);
		}
	}
942834
public function log($level, $message, array $context = array())
    {
        if ($this->_logLevel >= self::LOG_LEVEL_DEBUG) {
            error_log($message . "\n", 3, $this->_logFile);
        }
    }
1095414
public function log($level, $message, array $context = array())
    {
        $this->getClient()->notify(
            $message,
            array_merge(['level' => $this->levelMapping[$level]], $this->getExtractor()->extract($context))
        );
    }
1008257
public function log($level, $message, array $context = [])
    {
        $messageWithContext = $this->interpolate($message, $context);
        switch ($level) {
            case PsrLogLevel::EMERGENCY:
                Logger::emergency($messageWithContext);
                break;
            case PsrLogLevel::ALERT:
                Logger::alert($messageWithContext);
                break;
            case PsrLogLevel::CRITICAL:
                Logger::critical($messageWithContext);
                break;
            case PsrLogLevel::ERROR:
                Logger::error($messageWithContext);
                break;
            case PsrLogLevel::WARNING:
                Logger::warning($messageWithContext);
                break;
            case PsrLogLevel::NOTICE:
                Logger::notice($messageWithContext);
                break;
            case PsrLogLevel::INFO:
                Logger::info($messageWithContext);
                break;
            case PsrLogLevel::DEBUG:
                Logger::debug($messageWithContext);
                break;
            default:
                throw new \Psr\Log\InvalidArgumentException(
                    'Unknown log level: ' . var_export($level, true),
                    1485455196
                );
        }
    }
355601
public function log($level, $message, array $context = [])
    {
        $requestId = isset($context['requestId']) ? $context['requestId'] : uniqid('eight_points_guzzle_');

        if (array_key_exists($requestId, $this->messages)) {
            $logMessage = $this->messages[$requestId];
        } else {
            $logMessage = new LogMessage($message);
        }

        $logMessage->setLevel($level);

        if (!empty($context)) {
            if (!empty($context['request'])) {
                $logMessage->setRequest(new LogRequest($context['request']));
            }

            if (!empty($context['response'])) {
                $logMessage->setResponse(new LogResponse($context['response']));
            }
        }

        $this->messages[$requestId] = $logMessage;
    }
16077
public function log($level, $message, array $context = array()) {
		$fn = $this->callback;
		$fn($level, $message, $context);
		$this->logger()->log($level, $message, $context);
	}
22644
public function log($level, $message, array $context = array())
    {
        if (!$this->shouldHandle($level)) {
            return false;
        }

        $levelName = is_int($level) ? array_search($level, self::$levels) : $level;
        $message = $this->interpolate(
            array(
                'message' => $message,
                'context' => $context,
                'level' => strtoupper($levelName),
                'datetime' => new \DateTime(),
            )
        );

        $this->write($message);
    }
743932
public function log($level, $message, $context = [])
    {
        // This will be empty when output messages are triggered by the command
        // when it's NOT called by a worker option
        if (empty($this->logger)) {
            return;
        }

        // Call the logger's level specific methods
        $method = 'add'.ucfirst($level);
        $this->logger->$method($message, $context);
    }
1359484
public function log($level, $message, array $context = array())
    {
        $this->dispatcher->dispatch(Log::EVENT_NAME, new Log($level, $message, $context, []));
    }
979632
public function log($level, $message, array $context = [])
    {
        if (!$this->enabled) {
            return;
        }
        $message = self::replace($message, $context);
        if (is_resource($this->resource)) {
            fwrite($this->resource, "[{$level}] " . $message. "\n");
        } elseif (is_callable($this->resource)) {
            call_user_func($this->resource, "[{$level}] {$message}\n");
        } else {
            echo "[{$level}] {$message}\n";
        }
    }