You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/logging.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,3 +145,29 @@ query string of `url.full` wholesale (`https://host/path?[redacted]`) and drops
145
145
(`user:pass@`) before logging, so credentials in an outbound URL never reach the log.
146
146
147
147
Still: do not put credentials or token strings into log context in the first place.
148
+
149
+
## Database connection errors
150
+
151
+
A DBAL driver middleware (`App\Doctrine\Middleware\ConnectionErrorMiddleware`) logs
152
+
connection-**establishment** failures on the `database` channel so operators without
153
+
database access get a failure signal (ADR 011). It reads the raw driver error code (a
154
+
middleware sits below DBAL's exception conversion, which does not classify
155
+
`1040`/`1203`/`2003` as `ConnectionException`), fires for every SAPI (web, CLI, Messenger),
156
+
and rethrows the original exception unchanged — it is logging-only, with no reconnect.
157
+
158
+
The record uses the static message `Database connection failed` with:
159
+
160
+
| Key | Meaning |
161
+
|---|---|
162
+
| `event` | Always `db.connection_error`. |
163
+
| `db.response.status_code` | MySQL/MariaDB error number as a string (e.g. `1040`, `1045`, `2003`); OTel db semconv. |
164
+
| `error.type` | Low-cardinality OTel categorisation of the failure (e.g. `too_many_connections`, `access_denied`); falls back to the stringified code when unmapped. The verbose driver message stays in `exception.message`. |
165
+
| `db.sqlstate` | The SQLSTATE, when available. |
166
+
| `server.address` | Connection host only (OTel `server.*`) — never the password or full DSN. |
167
+
| `server.port` | Connection port (OTel `server.*`); emitted only when the connection params carry one. |
168
+
| `exception` | The structured `\Throwable` (via `ExceptionContextProcessor`). |
0 commit comments