Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,19 @@ private function logViaWonolog(string $level, mixed $message, array $context): v
}

if (\function_exists('do_action')) {
do_action($actionName, $message, $context);
// BUGFIX: Wonolog v2.x/v3.x PSR-3 placeholder substitution compatibility
//
// HookLogFactory::fromString() wraps context as $arguments = [0 => $context],
// breaking PsrLogMessageProcessor placeholders like {handle} and {url}.
//
// Using array format forces fromArray() method which preserves correct
// context structure. This works with all current Wonolog versions and
// has no negative side effects.
$logData = [
'message' => $message,
'context' => $context,
];
do_action($actionName, $logData);
}
}

Expand Down