Summary
The Logs tab in the Dumps window shows the log level and message, but never the
context array Laravel attaches to Log::info()/Log::error()/etc. calls, even when
the daemon is receiving non-empty context in the event payload.
Where
apps/yerd-gui/src/views/DumpsWindowView.vue, rowBody():
case "log":
return `${str(p.level)} ${str(p.message)}`.trim();
p.context is never read. The docs already promise this (docs/guide/laravel-dumps.md):
Logs | Log writes, with level and context
Fix
Append p.context (pretty-printed) to the row body when it's a non-empty object:
case "log": {
const head = `${str(p.level)} ${str(p.message)}`.trim();
const ctx = p.context;
const hasCtx = ctx !== undefined && ctx !== null && !(typeof ctx === "object" && Object.keys(ctx).length === 0);
return hasCtx ? `${head}\n${JSON.stringify(ctx, null, 2)}` : head;
}
Related
While testing this against a real app, found a second, upstream bug: the yerd-dump
extension itself sends an empty context: {} whenever any context value isn't
string-coercible (e.g. a nested array), dropping the whole context rather than just
that key. Filed separately: forjedio/yerd-php-ext#3. Both need fixing for context to
show up end-to-end for typical Laravel log calls.
Summary
The Logs tab in the Dumps window shows the log level and message, but never the
contextarray Laravel attaches toLog::info()/Log::error()/etc. calls, even whenthe daemon is receiving non-empty context in the event payload.
Where
apps/yerd-gui/src/views/DumpsWindowView.vue,rowBody():p.contextis never read. The docs already promise this (docs/guide/laravel-dumps.md):Fix
Append
p.context(pretty-printed) to the row body when it's a non-empty object:Related
While testing this against a real app, found a second, upstream bug: the
yerd-dumpextension itself sends an empty
context: {}whenever any context value isn'tstring-coercible (e.g. a nested array), dropping the whole context rather than just
that key. Filed separately: forjedio/yerd-php-ext#3. Both need fixing for context to
show up end-to-end for typical Laravel log calls.