@@ -33,40 +33,40 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | protected function prepareTags(array $record): array |
| 35 | 35 | { |
| 36 | - $tags = []; |
|
| 36 | + $tags = [ ]; |
|
| 37 | 37 | |
| 38 | - if (isset($_SERVER['REMOTE_ADDR'])) { |
|
| 39 | - $tags['serverName'] = $_SERVER['REMOTE_ADDR']; |
|
| 38 | + if (isset($_SERVER[ 'REMOTE_ADDR' ])) { |
|
| 39 | + $tags[ 'serverName' ] = $_SERVER[ 'REMOTE_ADDR' ]; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if (isset($record['level'])) { |
|
| 43 | - $tags['severity'] = $this->rfc5424ToSeverity($record['level']); |
|
| 42 | + if (isset($record[ 'level' ])) { |
|
| 43 | + $tags[ 'severity' ] = $this->rfc5424ToSeverity($record[ 'level' ]); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (isset($_SERVER['REQUEST_URI'])) { |
|
| 47 | - $tags['endpoint_url'] = $_SERVER['REQUEST_URI']; |
|
| 46 | + if (isset($_SERVER[ 'REQUEST_URI' ])) { |
|
| 47 | + $tags[ 'endpoint_url' ] = $_SERVER[ 'REQUEST_URI' ]; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if (isset($_SERVER['REQUEST_METHOD'])) { |
|
| 51 | - $tags['method'] = $_SERVER['REQUEST_METHOD']; |
|
| 50 | + if (isset($_SERVER[ 'REQUEST_METHOD' ])) { |
|
| 51 | + $tags[ 'method' ] = $_SERVER[ 'REQUEST_METHOD' ]; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - if (isset($record['context']['user_id'])) { |
|
| 55 | - $tags['user_id'] = $record['context']['user_id']; |
|
| 54 | + if (isset($record[ 'context' ][ 'user_id' ])) { |
|
| 55 | + $tags[ 'user_id' ] = $record[ 'context' ][ 'user_id' ]; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if (isset($record['context']['project_id'])) { |
|
| 59 | - $tags['project_id'] = $record['context']['project_id']; |
|
| 58 | + if (isset($record[ 'context' ][ 'project_id' ])) { |
|
| 59 | + $tags[ 'project_id' ] = $record[ 'context' ][ 'project_id' ]; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (isset($record['context']['file'])) { |
|
| 63 | - $tags['file'] = $this->replaceDigitData($record['context']['file']); |
|
| 62 | + if (isset($record[ 'context' ][ 'file' ])) { |
|
| 63 | + $tags[ 'file' ] = $this->replaceDigitData($record[ 'context' ][ 'file' ]); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if (isset($record['context']['event']['api_stats'][0])) { |
|
| 67 | - foreach ($record['context']['event']['api_stats'][0] as $key => $value) { |
|
| 66 | + if (isset($record[ 'context' ][ 'event' ][ 'api_stats' ][ 0 ])) { |
|
| 67 | + foreach ($record[ 'context' ][ 'event' ][ 'api_stats' ][ 0 ] as $key => $value) { |
|
| 68 | 68 | if (is_string($value) || is_int($value)) { |
| 69 | - $tags[$key] = $value; |
|
| 69 | + $tags[ $key ] = $value; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | if (count($tags)) { |
| 92 | 92 | foreach ($tags as $key => $value) { |
| 93 | 93 | if (is_numeric($value)) { |
| 94 | - $message['fields'][$key] = (int)$value; |
|
| 94 | + $message[ 'fields' ][ $key ] = (int) $value; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - $message['tags'] = $tags; |
|
| 98 | + $message[ 'tags' ] = $tags; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if (isset($message['fields']['Debug']['message'])) { |
|
| 102 | - $message['fields']['Debug']['message'] = $this->trimLines($message['fields']['Debug']['message']); |
|
| 101 | + if (isset($message[ 'fields' ][ 'Debug' ][ 'message' ])) { |
|
| 102 | + $message[ 'fields' ][ 'Debug' ][ 'message' ] = $this->trimLines($message[ 'fields' ][ 'Debug' ][ 'message' ]); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | return $message; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | 600 => 'Emergency', |
| 124 | 124 | ]; |
| 125 | 125 | |
| 126 | - $result = isset($levels[$level]) ? $levels[$level] : $levels[600]; |
|
| 126 | + $result = isset($levels[ $level ]) ? $levels[ $level ] : $levels[ 600 ]; |
|
| 127 | 127 | |
| 128 | 128 | return $result; |
| 129 | 129 | } |