Skip to content

[ticket/17550] Log uncaught server errors to the PHP error log#6972

Open
ECYaz wants to merge 1 commit into
phpbb:masterfrom
ECYaz:ticket/17550
Open

[ticket/17550] Log uncaught server errors to the PHP error log#6972
ECYaz wants to merge 1 commit into
phpbb:masterfrom
ECYaz:ticket/17550

Conversation

@ECYaz

@ECYaz ECYaz commented Jun 28, 2026

Copy link
Copy Markdown

Uncaught exceptions that result in an HTTP 500 response were rendered as the generic error page but were never logged anywhere, so they could not be diagnosed (PHPBB-17550).

This logs server errors (HTTP 5xx) from kernel_exception_subscriber to the PHP error log, including the exception message and stack trace. Client errors such as 404/403 are intentionally not logged, to avoid noise. error_log() is used rather than the database-backed log because the database may itself be unavailable during a 500.

Note: the same gap exists in the analogous 3.3.x exception subscriber. I've targeted master because the ticket is filed against 4.0.0-a1 and the symptom is the Symfony 4.x error page, but I'm happy to provide a 3.3.x backport if the team prefers.

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17550

Uncaught exceptions that result in an HTTP 500 response were rendered as
the generic error page but never logged anywhere, making them impossible
to diagnose. Log server errors (5xx) to the PHP error log from the kernel
exception subscriber, including the message and stack trace; client errors
such as 404 are intentionally left unlogged to avoid noise.

PHPBB-17550
@rubencm

rubencm commented Jun 28, 2026

Copy link
Copy Markdown
Member

#6361

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.

2 participants