Skip to content

Render log context in Front error comments - #24

Merged
edalzell merged 1 commit into
mainfrom
feature/log-context-in-comments
Sep 16, 2026
Merged

edalzell merged 1 commit into
mainfrom
feature/log-context-in-comments

Conversation

@edalzell

Copy link
Copy Markdown
Member

LogHandler reads only context.exception from the log record and drops the rest of the context, so anything an app attaches for triage never reaches the Front conversation. A handler that reports Log::error('Redis unavailable', ['uptime_in_seconds' => 12]) gets a comment with the message and stack trace only, and the context has to be dug out of laravel.log on the server instead.

Laravel's exception handler merges exceptionContext() (plus userId) into that same context array, so this affects every site using the front log channel, not just explicit Log:: calls.

The exception path now renders the remaining context keys as bullets between the file/line and the stack trace — * redis: {"loading":1,"uptime_in_seconds":12} — with exception excluded since it is already rendered as the message and trace. Strings print as-is, everything else is JSON encoded.

@edalzell
edalzell marked this pull request as ready for review September 16, 2026 16:47
@edalzell
edalzell merged commit c36509c into main Sep 16, 2026
9 checks passed
@edalzell
edalzell deleted the feature/log-context-in-comments branch September 16, 2026 16:48
@edalzell edalzell mentioned this pull request Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant