Skip to content

Instantly share code, notes, and snippets.

@marcusramberg
Created September 13, 2019 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusramberg/d22fae35c86191d931ee3778c5be9e84 to your computer and use it in GitHub Desktop.
Save marcusramberg/d22fae35c86191d931ee3778c5be9e84 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojolicious/Plugin/DefaultHelpers.pm b/lib/Mojolicious/Plugin/DefaultHelpers.pm
index 5226026cf..db04ef688 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