Skip to content

fixes: issue-27 Logging for db exception should be more context rich#28

Merged
kayjoosten merged 2 commits intomainfrom
feature/issue-27-fix-db-logging
Apr 17, 2026
Merged

fixes: issue-27 Logging for db exception should be more context rich#28
kayjoosten merged 2 commits intomainfrom
feature/issue-27-fix-db-logging

Conversation

@kayjoosten
Copy link
Copy Markdown
Contributor

No description provided.

When you run composer install with php 8.5 it will break.
Therefore, we have to lock the version to 8.2 this is bcuz
we want to support from 8.2 onwards not from 8.5
Fixes #27. Exceptions caught in DoctrineConnectionHealthCheck and
HealthController were silently swallowed, making database failures
impossible to diagnose from logs. Inject LoggerInterface and log
the full exception as context so Monolog includes the stack trace.
@kayjoosten kayjoosten changed the title Feature/issue 27 fix db logging fixes: issue-27 Logging for db exception should be more context rich Apr 10, 2026
@kayjoosten kayjoosten requested a review from johanib April 10, 2026 11:28
@johanib johanib linked an issue Apr 13, 2026 that may be closed by this pull request
Copy link
Copy Markdown

@johanib johanib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Passing the $exception to the log will include the needed context for the operator.

Be aware that the original ticket mentions engineblock. The DoctrineConnectionHealthCheck from this repo does not get used in EB, EB overrides that healthcheck. So might be worth it to also apply the changes in that Healthcheck.

@kayjoosten
Copy link
Copy Markdown
Contributor Author

Good catch ill check if it's needed there aswell

@kayjoosten kayjoosten merged commit a4b495a into main Apr 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message for database check is too generic

2 participants