Skip to content

Parser Edge Case #8

Description

@ps

The following line is not parsed properly:

[2017-05-31 14:16:19] testing.WARNING: DB - Query to get user_id for inactive login; logging only username in the table  [] {"file":"/home/pawel/project/app/Http/Controllers/Auth/LoginController.php","line":108,"class":"App\\Http\\Controllers\\Auth\\LoginController","function":"check"}

The following code was used to test:

// where 'sample_log.log' contains the log statement above'
$reader = new LogReader('sample_log.log');
foreach ($reader as $logLine) {
    var_dump($logLine);
}

Resulting parsing:

array(6) {
  'date' =>
  class DateTime#54 (3) {
    public $date =>
    string(26) "2017-05-31 14:16:19.000000"
    public $timezone_type =>
    int(3)
    public $timezone =>
    string(16) "America/New_York"
  }
  'logger' =>
  string(7) "testing"
  'level' =>
  string(7) "WARNING"
  'message' =>
  string(70) "DB - Query to get user_id for inactive login; logging only username in"
  'context' =>
  NULL
  'extra' =>
  NULL
}

By inspecting the log statement above manually it is obvious that the 'message' was cut off and there does exist an 'extra' array with attributes but was not parsed either.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions