mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 17:16:18 +02:00
Logmatic fix (#914)
* Adding the marker field to improve the Logmatic.io compatibilty
This commit is contained in:
committed by
Jordi Boggiano
parent
c7776bba2b
commit
908960d30b
@@ -18,6 +18,9 @@ namespace Monolog\Formatter;
|
||||
*/
|
||||
class LogmaticFormatter extends JsonFormatter
|
||||
{
|
||||
|
||||
const MARKERS = ["sourcecode", "php"];
|
||||
|
||||
/**
|
||||
* @param string
|
||||
*/
|
||||
@@ -57,12 +60,14 @@ class LogmaticFormatter extends JsonFormatter
|
||||
public function format(array $record): string
|
||||
{
|
||||
if (!empty($this->hostname)) {
|
||||
$record['hostname'] = $this->hostname;
|
||||
$record["hostname"] = $this->hostname;
|
||||
}
|
||||
if (!empty($this->appname)) {
|
||||
$record['appname'] = $this->appname;
|
||||
$record["appname"] = $this->appname;
|
||||
}
|
||||
|
||||
$record["@marker"] = self::MARKERS;
|
||||
|
||||
return parent::format($record);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user