-
Notifications
You must be signed in to change notification settings - Fork 2
[WIP] DAPH-180 Fix CustomJsonTest and register all Symfony's error handlers in a new CommonUtils\Sirius\Logging\ErrorHandling class #12
Conversation
Signed-off-by: Vítor Brandão <vitor@noiselabs.io>
…irius\Logging\ErrorHandling class Signed-off-by: Vítor Brandão <vitor@noiselabs.io>
Module.php
Outdated
//global catchall to log when a 400 or 500 error message is set on a response. | ||
//This is mainly for logging purposes. | ||
$eventManager->attach( | ||
MvcEvent::EVENT_FINISH, | ||
function ($e) use ($logger, $extractor) { | ||
function ($e) use ($logger, $extractor, $serviceManager) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger is used; yet you pull from the service manager further down?
…ctions Signed-off-by: Vítor Brandão <vitor@noiselabs.io>
Signed-off-by: Vítor Brandão <vitor@noiselabs.io>
'category' => 'Event', | ||
) | ||
); | ||
$logger->warn('Response: ' . $statusCode . '[' . $e->getResponse() . ']', ['category' => 'Event']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might this log sensitive information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might. However, there are no functional changes introduced in this PR, this is merely a cosmetic change.
composer.json
Outdated
"zendframework/zendframework": "2.*", | ||
"psr/log": "^1.0" | ||
"psr/log": "^1.0", | ||
"symfony/debug": ">=2.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you put an upper bound on this constraint?
@@ -2,23 +2,10 @@ | |||
|
|||
namespace CommonUtils\Sirius\Logging; | |||
|
|||
use Zend\Db\TableGateway\Exception\RuntimeException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the code was using a RuntimeException could it be pre-fixed with a ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RuntimeException
isn't being used in this class. Safe to remove.
Signed-off-by: Vítor Brandão <vitor@noiselabs.io>
Signed-off-by: Vítor Brandão vitor@noiselabs.io