File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 66use Neos \Flow \Log \ThrowableStorageInterface ;
77use Neos \Flow \ObjectManagement \ObjectManagerInterface ;
88use Networkteam \SentryClient \ErrorHandler ;
9+ use Networkteam \Util \Log \ThrowableStorage \ConsoleStorage ;
910
1011class DebugExceptionHandler extends DebugExceptionHandlerBase
1112{
@@ -27,7 +28,11 @@ public function handleException($exception)
2728
2829 $ exceptionWasLogged = false ;
2930 if ($ this ->throwableStorage instanceof ThrowableStorageInterface && isset ($ this ->renderingOptions ['logException ' ]) && $ this ->renderingOptions ['logException ' ]) {
30- $ this ->throwableStorage ->logThrowable ($ exception , ['sentryEventId ' => $ eventId ]);
31+ $ message = $ this ->throwableStorage ->logThrowable ($ exception , ['sentryEventId ' => $ eventId ]);
32+ // ConsoleStorage logs json to the console like the other loggers, so do not log twice.
33+ if (!$ this ->throwableStorage instanceof ConsoleStorage) {
34+ $ this ->logger ->critical ($ message );
35+ }
3136 $ exceptionWasLogged = true ;
3237 }
3338
Original file line number Diff line number Diff line change 66use Neos \Flow \Log \ThrowableStorageInterface ;
77use Neos \Flow \ObjectManagement \ObjectManagerInterface ;
88use Networkteam \SentryClient \ErrorHandler ;
9+ use Networkteam \Util \Log \ThrowableStorage \ConsoleStorage ;
910
1011class ProductionExceptionHandler extends ProductionExceptionHandlerBase
1112{
@@ -28,7 +29,11 @@ public function handleException($exception)
2829
2930 $ exceptionWasLogged = false ;
3031 if ($ this ->throwableStorage instanceof ThrowableStorageInterface && isset ($ this ->renderingOptions ['logException ' ]) && $ this ->renderingOptions ['logException ' ]) {
31- $ this ->throwableStorage ->logThrowable ($ exception , ['sentryEventId ' => $ eventId ]);
32+ $ message = $ this ->throwableStorage ->logThrowable ($ exception , ['sentryEventId ' => $ eventId ]);
33+ // Our ConsoleStorage logs json to the console like the other loggers, so do not log twice.
34+ if (!$ this ->throwableStorage instanceof ConsoleStorage) {
35+ $ this ->logger ->critical ($ message );
36+ }
3237 $ exceptionWasLogged = true ;
3338 }
3439
You can’t perform that action at this time.
0 commit comments