refs #1324. CustomLineFormatter
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
parent
166c629906
commit
4efa843445
|
@ -2,7 +2,25 @@
|
||||||
|
|
||||||
namespace App\Formatter;
|
namespace App\Formatter;
|
||||||
|
|
||||||
class CustomLineFormatter
|
use Monolog\Formatter\LineFormatter;
|
||||||
{
|
|
||||||
|
|
||||||
|
class CustomLineFormatter extends LineFormatter
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct(null, 'Y-m-d H:i:s', true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function format($record): string
|
||||||
|
{
|
||||||
|
$output = [
|
||||||
|
'severity' => $record['level_name'],
|
||||||
|
'operation' => $record['channel'],
|
||||||
|
'component' => 'ogcore',
|
||||||
|
'params' => $record['context'],
|
||||||
|
'desc' => $record['message'],
|
||||||
|
];
|
||||||
|
|
||||||
|
return json_encode($output, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue