mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-24 18:16:10 +02:00
Add scalar types to processor/formatters and top level classes
This commit is contained in:
@@ -21,10 +21,8 @@ class LogglyFormatter extends JsonFormatter
|
||||
/**
|
||||
* Overrides the default batch mode to new lines for compatibility with the
|
||||
* Loggly bulk API.
|
||||
*
|
||||
* @param int $batchMode
|
||||
*/
|
||||
public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false)
|
||||
public function __construct(int $batchMode = self::BATCH_MODE_NEWLINES, bool $appendNewline = false)
|
||||
{
|
||||
parent::__construct($batchMode, $appendNewline);
|
||||
}
|
||||
@@ -35,7 +33,7 @@ class LogglyFormatter extends JsonFormatter
|
||||
* @see https://www.loggly.com/docs/automated-parsing/#json
|
||||
* @see \Monolog\Formatter\JsonFormatter::format()
|
||||
*/
|
||||
public function format(array $record)
|
||||
public function format(array $record): string
|
||||
{
|
||||
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTimeInterface)) {
|
||||
$record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
|
||||
|
||||
Reference in New Issue
Block a user