ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLineFormatter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use Monolog\Formatter\LineFormatter as LineFormatter;
22use Monolog\LogRecord;
23
30class ilLineFormatter extends LineFormatter
31{
35 public function format(LogRecord $record): string
36 {
37 if (isset($record["extra"]["trace"])) {
38 $trace = $record["extra"]["trace"];
39 unset($record["extra"]["trace"]);
40 $record = $record->with(
41 message: $trace . " " . $record["message"],
42 extra: $record["extra"]
43 );
44 }
45
46 $record = $record->with(context: []);
47
48 return parent::format($record);
49 }
50}
Custom line formatter.
format(LogRecord $record)
@inheritDoc