Skip to content

Commit 3619579

Browse files
committed
Improve log parsing, fixes #22
1 parent add2eac commit 3619579

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Controller/LogController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
*/
1919
class LogController
2020
{
21-
private const LINE_MATCH = '/\[(?<date>.*)] (?<channel>\w*)\.(?<level>\w*):(?<message>.*)/m';
21+
// https://regex101.com/r/bp4YYL/1
22+
private const LINE_MATCH = '/\[(?<date>.*)] (?<channel>.*)\.(?<level>(DEBUG|INFO|NOTICE|WARNING|ERROR|CRITICAL|ALERT|EMERGENCY)):(?<message>.*)/m';
2223

2324
private string $logDir;
2425

0 commit comments

Comments
 (0)