Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/lib/Mojolicious/Plugin/DefaultHelpers.pm b/lib/Mojolicious/Plugin/DefaultHelpers.pm
index 5226026cf..c6b983e6e 100644
--- a/lib/Mojolicious/Plugin/DefaultHelpers.pm
+++ b/lib/Mojolicious/Plugin/DefaultHelpers.pm
@@ -173,7 +173,9 @@ sub _is_fresh {
sub _log {
my $c = shift;
return $c->stash->{'mojo.log'}
- ||= $c->app->log->context('[' . $c->req->request_id . ']');
+ ||= $c->app->log->can('context')
+ ? $c->app->log->context('[' . $c->req->request_id . ']')
+ : $c->app->log;
}
sub _proxy_method_p {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment