Added multiline parsing
This commit is contained in:
@ -4,7 +4,7 @@ namespace ProVM\Logview\Parser;
|
||||
use Error;
|
||||
use Exception;
|
||||
use Safe\DateTimeImmutable;
|
||||
use function Safe\{fopen, preg_match_all, preg_match, error_log, json_encode};
|
||||
use function Safe\{fopen, fclose, preg_match_all, preg_match, error_log, json_encode};
|
||||
use ProVM\Common\Define\Log;
|
||||
use ProVM\Common\Implement\Parser;
|
||||
|
||||
@ -26,9 +26,10 @@ class PHPDefault extends Parser
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public function parse(string $content): Log
|
||||
public function parse(mixed &$file_handler): Log
|
||||
{
|
||||
$log = parent::parse($content);
|
||||
$log = parent::parse($file_handler);
|
||||
$content = $log->getOriginal();
|
||||
$regex = "/\[(?<date>\d{2}-\w{3}-\d{4}\s\d{2}:\d{2}:\d{2}\s\w{3})\]\s(?<level>PHP|User)\s(?<severity>\w+):\s(?<message>.*)/";
|
||||
try {
|
||||
preg_match($regex, $content, $matches);
|
||||
|
Reference in New Issue
Block a user