Skip to content

refactor(logging): log uncaught exceptions to stderr - #1807

Open
lucs7 wants to merge 1 commit into
LibreBooking:developfrom
lucs7:fix/logging-exception-handler
Open

lucs7 wants to merge 1 commit into
LibreBooking:developfrom
lucs7:fix/logging-exception-handler

Conversation

@lucs7

@lucs7 lucs7 commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

The global exception handler now writes uncaught exceptions to stderr
with real newlines instead of a single escaped line.

  • Includes the previous-exception chain
  • Escapes control characters to prevent log forging
  • Uses colors only when stderr is a TTY
  • Falls back to error_log() if stderr is unavailable

Testing

  • Added tests/lib/Common/Logging/ExceptionHandlerTest.php
    (chain, escaping, TTY/no-TTY, fallback, no-throw)

🤖 Generated with Claude Code

Write uncaught exceptions to stderr with real newlines, including the
previous-exception chain. Escape control characters to prevent log
forging, use colors only on a TTY, fall back to error_log() and never
throw from the handler.

Assisted-by: Claude:claude-sonnet-5-5
Copilot AI balanced review requested due to automatic review settings October 17, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
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