@param       $level
@param       $message
@param array $context

@return Collection
177502
protected function prepareRecord(string $level, string $message = null, array $context = []): Collection
    {
        $message = new Collection([
            'content' => $message,
            'context' => $context,
        ]);
        
        $datetime = new DateTime();
        $datetime->setFormat($this->getDatetimeFormat());
        
        $record = new Collection([
            'name'         => $this->name,
            'level'        => strtoupper($level),
            'levelBitmask' => new LogLevelMask($level),
            'datetime'     => $datetime,
            'message'      => $message,
        ]);
        
        $this->placeholders->each(function ($name, PlaceholderInterface $placeholder) use ($record) {
            $placeholder->complement($record);
        });
        
        return $record;
    }
1013714
public function addRecord($level, $message, array $context = array())
    {
        $replacement = array();
        foreach ($context as $key=>$value) {
            if (!is_array($value)) {
                $rkey = '%'.$key.'%';
                $replacement[$rkey] = $value;
                if (false!==strpos($message,$rkey)) {
                    unset($context[$key]);
                }
            }
        }
        $message = strtr($message,$replacement);

        return parent::addRecord($level, $message, $context);
    }
66312
public function format($level, $message, array $context = array())
    {
        if (!is_object($message)) {
            return $this->formatter->format('', $message, $context);
        }

        //Mark this object as processed so we don't convert it twice and it
        //Also avoid recursion when objects refer to each other
        $this->_processed[] = $message;

        $object_as_array = array();

        // first add the class name
        $object_as_array['___class_name'] = get_class($message);

        // loop through object vars
        $object_vars = get_object_vars($message);

        foreach ($object_vars as $key => $value) {
            // same instance as parent object
            if ($value === $message || in_array($value, $this->_processed, true)) {
                $value = 'recursion - parent object [' . get_class($value) . ']';
            }
            $object_as_array[$key] = $this->format('', $value, $context);
        }

        $reflection = new ReflectionClass($message);

        // loop through the properties and add those
        foreach ($reflection->getProperties() as $property) {
            // if one of these properties was already added above then ignore it
            if (array_key_exists($property->getName(), $object_vars)) {
                continue;
            }

            $type = $this->getPropertyKey($property);
            if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
                $property->setAccessible(true);
            }

            try {
                $value = $property->getValue($message);
            } catch (ReflectionException $e) {
                $value = 'only PHP 5.3 can access private/protected properties';
            }

            // same instance as parent object
            if ($value === $message || in_array($value, $this->_processed, true)) {
                $value = 'recursion - parent object [' . get_class($value) . ']';
            }

            // Next line changed from original project
            $object_as_array[$type] = $this->formatObjectHandleArray($value, $context);
        }

        return array($object_as_array);
    }
1311615
public function log($level, $message, array $context = array())
    {
        $context = array_merge($this->decorations, $context);

        $this->getInnerLogger()->log($level, $message, $context);
    }
21184
public function log($level, $message, array $context = array()) {
		foreach($this->keyValueArray as $key => $value) {
			if(is_object($value)) {
				if(method_exists($value, '__toString')) {
					$value = (string)$value;
				} else {
					$value = json_encode($value);
				}
			}
			$context[$key] = $value;
		}
		$this->logger()->log($level, $message, $context);
	}
912927
protected static function formatLine($level, $message, array $context = array())
    {
        return sprintf(
            "%s: %s\n",
            self::getLevelName($level),
            self::interpolateMessage($message, $context)
        );
    }
239600
public function log($level, $message, array $context = array())
    {
        $allContext = array_merge($this->extraContext, $context);

        $this->logger->log($level, $message, $allContext);
    }
1344631
public function log($level, $message, array $context = array()) {
		$message = preg_replace("/[\r\n]+/", $this->replacement, $message);
		$this->logger()->log($level, $message, $context);
	}
628941
private function formatMessage($level, $message, $context)
    {
        $level = strtoupper($level);
        if (!empty($context)) {
            $message .= PHP_EOL . $this->indent($this->contextToString($context));
        }
        return "[{$this->getTimestamp()}] [{$level}] {$message}" . PHP_EOL;
    }
81952
public function log($level, $message, array $context = array()) {
		$parts = array();
		if(is_array($this->caption)) {
			$parts[] = join($this->concatenator, $this->caption);
		} elseif(is_scalar($this->caption)) {
			/** @var mixed $caption */
			$caption = $this->caption;
			$parts[] = (string) $caption;
		}
		$parts[] = $message;
		$parts = array_filter($parts);
		$newMessage = join($this->endingConcatenator, $parts);
		$this->logger()->log($level, $newMessage, $context);
	}
352224
public function format(string $level, string $message, array $context)
    {
        if ($this->formatter !== null)
            return $this->formatter->format($level, $message, $context);

        // Fall back to the logger placeholder filler
        return Logger::fillPlaceholders($message, $context);
    }
250457
static public function log($level, $message, array $context = array())
    {
        self::getDefaultLogger()->log($level, $message, $context);
    }
1053170
public function log($level, $message, array $context = array())
    {
        $this->getApplication()->getInitialContext()->getSystemLogger()->log($level, $message, $context);
    }
161868
public function log($level, $message, array $context = [])
    {
        if (in_array($level, $this->acceptedLevels, true)) {
            $this->logger->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";
        }
    }
48620
private static function log(string $level, string $message, array $context = [])
    {
        if (static::$logger !== null) {
            static::$logger->$level($message, $context);
        }
    }
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);
    }