{"action":"closed","issue":{"url":"https://api.github.com/repos/augensalat/mojolicious-plugin-accesslog/issues/3","labels_url":"https://api.github.com/repos/augensalat/mojolicious-plugin-accesslog/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/augensalat/mojolicious-plugin-accesslog/issues/3/comments","events_url":"https://api.github.com/repos/augensalat/mojolicious-plugin-accesslog/issues/3/events","html_url":"https://github.com/augensalat/mojolicious-plugin-accesslog/issues/3","id":21944265,"number":3,"title":"Allow $c in log function","user":{"login":"jhthorsen","id":45729,"avatar_url":"https://avatars.githubusercontent.com/u/45729?v=3","gravatar_id":"","url":"https://api.github.com/users/jhthorsen","html_url":"https://github.com/jhthorsen","followers_url":"https://api.github.com/users/jhthorsen/followers","following_url":"https://api.github.com/users/jhthorsen/following{/other_user}","gists_url":"https://api.github.com/users/jhthorsen/gists{/gist_id}","starred_url":"https://api.github.com/users/jhthorsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhthorsen/subscriptions","organizations_url":"https://api.github.com/users/jhthorsen/orgs","repos_url":"https://api.github.com/users/jhthorsen/repos","events_url":"https://api.github.com/users/jhthorsen/events{/privacy}","received_events_url":"https://api.github.com/users/jhthorsen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-11-01T06:37:33Z","updated_at":"2015-01-02T12:45:47Z","closed_at":"2015-01-02T12:45:47Z","body":"I'm doing this now: (which of course is not very nice)\r\n\r\n    {\r\n      require Mojolicious::Plugin::AccessLog;\r\n      no warnings 'redefine';\r\n      my $hack = \\&Mojolicious::Plugin::AccessLog::_log;\r\n      *Mojolicious::Plugin::AccessLog::_log = sub {\r\n        my($c, @args) = @_;\r\n        local $main::LOG_KEY = $c->session('reference') || $c->session('username');\r\n        MyLogger->log(info => $hack->($c, @args));\r\n      };\r\n    }\r\n\r\n    $app->plugin('Mojolicious::Plugin::AccessLog' => log => sub {});\r\n \r\nIs there a way you could add a \"log\" callback which gets $c passed on as well as the log message? Or would you consider taking a pull request for this feature?"}}