|
4 | 4 |
|
5 | 5 | namespace Networkteam\Util\Log\ThrowableStorage; |
6 | 6 |
|
7 | | -use Neos\Flow\Configuration\ConfigurationManager; |
8 | 7 | use Neos\Flow\Core\Bootstrap; |
9 | 8 | use Neos\Flow\Http\HttpRequestHandlerInterface; |
10 | 9 | use Neos\Flow\Log\Exception\CouldNotOpenResourceException; |
@@ -48,30 +47,18 @@ public static function createWithOptions(array $options): ThrowableStorageInterf |
48 | 47 |
|
49 | 48 | public function logThrowable(\Throwable $throwable, array $additionalData = []) |
50 | 49 | { |
51 | | - if (Bootstrap::$staticObjectManager instanceof ObjectManagerInterface) { |
52 | | - $bootstrap = Bootstrap::$staticObjectManager->get(Bootstrap::class); |
53 | | - /** @var ConfigurationManager $configurationManager */ |
54 | | - $configurationManager = $bootstrap->getEarlyInstance(ConfigurationManager::class); |
55 | | - |
56 | | - $serviceContext = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, |
57 | | - 'Networkteam.Util.serviceContext'); |
58 | | - } else { // @phpstan-ignore-line |
59 | | - $serviceContext = 'neos-flow'; |
60 | | - } |
61 | | - |
62 | 50 | $data = [ |
63 | 51 | 'eventTime' => (new \DateTime('now'))->format(DATE_RFC3339), |
64 | | - 'serviceContext' => $serviceContext, |
65 | | - 'message' => sprintf('PHP Warning: %s', $throwable->getMessage()), |
66 | | - 'stackTrace' => $throwable->getTraceAsString(), |
67 | | - 'context' => [ |
68 | | - 'httpRequest' => $this->getHttpRequestContext(), |
69 | | - 'reportLocation' => [ |
70 | | - 'filePath' => $throwable->getFile(), |
71 | | - 'lineNumber' => $throwable->getLine(), |
72 | | - 'functionName' => self::getFunctionNameForTrace($throwable->getTrace()), |
73 | | - ], |
74 | | - ] |
| 52 | + 'severity' => 'error', |
| 53 | + 'message' => $throwable->getMessage(), |
| 54 | + 'errorLocation' => [ |
| 55 | + 'filePath' => $throwable->getFile(), |
| 56 | + 'lineNumber' => $throwable->getLine(), |
| 57 | + 'functionName' => self::getFunctionNameForTrace($throwable->getTrace()), |
| 58 | + ], |
| 59 | + 'httpRequest' => $this->getHttpRequestContext(), |
| 60 | + 'additionalData' => $additionalData, |
| 61 | + 'source' => 'neos-flow' |
75 | 62 | ]; |
76 | 63 |
|
77 | 64 | $output = json_encode($data); |
|
0 commit comments