Skip to content

Commit

Permalink
Merge pull request #30 from JackieDo/version-2.x
Browse files Browse the repository at this point in the history
Update log parser
  • Loading branch information
JackieDo authored Apr 8, 2020
2 parents 5417c68 + c08b69d commit 8295c49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Jackiedo/LogReader/Entities/LogEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ protected function setLevel($level = null)
protected function setFilePath($path = null)
{
if ($path) {
$this->file_path = $path;
$this->file_path = realpath($path);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Jackiedo/LogReader/LogParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class LogParser implements LogParserInterface
const LOG_DATE_PATTERN = "\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\]";
const LOG_ENVIRONMENT_PATTERN = "(\w+)";
const LOG_LEVEL_PATTERN = "([A-Z]+)";
const CONTEXT_EXCEPTION_PATTERN = "exception\s\'{1}([^\']+)\'{1}";
const CONTEXT_MESSAGE_PATTERN = "(\swith\smessage\s\'{1}(.*)\'{1})?";
const CONTEXT_EXCEPTION_PATTERN = "((exception\s\'{1})?([^\s\']+)(\'{1}|\:)\s+)?";
const CONTEXT_MESSAGE_PATTERN = "(with\smessage\s)?(.*)?";
const CONTEXT_IN_PATTERN = "\sin\s(.*)\:(\d+)";
const STACK_TRACE_DIVIDER_PATTERN = "(\[stacktrace\]|Stack trace\:)";
const STACK_TRACE_INDEX_PATTERN = "\#\d+\s";
Expand Down

0 comments on commit 8295c49

Please sign in to comment.