@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $entry = new LogEntry(); |
| 34 | 34 | |
| 35 | 35 | foreach (array_filter(array_keys($data), 'is_string') as $key) { |
| 36 | - $entry->{$key} = trim($data[$key]); |
|
| 36 | + $entry->{$key} = trim($data[ $key ]); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | return $entry; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $this->prettyName = 'Syslog'; |
| 44 | 44 | |
| 45 | 45 | $this->addFormat('default', '%t %h %s%p: %m'); |
| 46 | - $this->defaultFormat = '%t %h %s%p: %m'; |
|
| 46 | + $this->defaultFormat = '%t %h %s%p: %m'; |
|
| 47 | 47 | |
| 48 | 48 | $this->addPath("/var/log/"); |
| 49 | 49 | $this->addFile("syslog"); |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | $this->addFile("user"); |
| 57 | 57 | $this->addFile("messages"); |
| 58 | 58 | |
| 59 | - $this->addPattern('%t', '(?P<time>(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\s\d|\d{2}) \d{2}:\d{2}:\d{2})'); |
|
| 60 | - $this->addPattern('%h', '(?P<hostname>.+?)'); |
|
| 61 | - $this->addPattern('%s', '(?P<service>[^\[:]+)'); |
|
| 62 | - $this->addPattern('%p', '(\[(?P<pid>\d+)\])?'); |
|
| 63 | - $this->addPattern('%m', '(?P<message>.+)'); |
|
| 59 | + $this->addPattern('%t', '(?P<time>(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\s\d|\d{2}) \d{2}:\d{2}:\d{2})'); |
|
| 60 | + $this->addPattern('%h', '(?P<hostname>.+?)'); |
|
| 61 | + $this->addPattern('%s', '(?P<service>[^\[:]+)'); |
|
| 62 | + $this->addPattern('%p', '(\[(?P<pid>\d+)\])?'); |
|
| 63 | + $this->addPattern('%m', '(?P<message>.+)'); |
|
| 64 | 64 | |
| 65 | 65 | parent::__construct($format, $factory); |
| 66 | 66 | } |