{"action":"reopened","issue":{"url":"https://api.github.com/repos/dominhhai/koa-log4js/issues/5","repository_url":"https://api.github.com/repos/dominhhai/koa-log4js","labels_url":"https://api.github.com/repos/dominhhai/koa-log4js/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/dominhhai/koa-log4js/issues/5/comments","events_url":"https://api.github.com/repos/dominhhai/koa-log4js/issues/5/events","html_url":"https://github.com/dominhhai/koa-log4js/issues/5","id":188697850,"number":5,"title":"How to get request body with customize token?","user":{"login":"fancyoung","id":243587,"avatar_url":"https://avatars.githubusercontent.com/u/243587?v=3","gravatar_id":"","url":"https://api.github.com/users/fancyoung","html_url":"https://github.com/fancyoung","followers_url":"https://api.github.com/users/fancyoung/followers","following_url":"https://api.github.com/users/fancyoung/following{/other_user}","gists_url":"https://api.github.com/users/fancyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/fancyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fancyoung/subscriptions","organizations_url":"https://api.github.com/users/fancyoung/orgs","repos_url":"https://api.github.com/users/fancyoung/repos","events_url":"https://api.github.com/users/fancyoung/events{/privacy}","received_events_url":"https://api.github.com/users/fancyoung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-11T07:00:47Z","updated_at":"2016-12-04T04:41:48Z","closed_at":null,"body":"The code support custom_tokens, but if the replacement is something like `ctx.request.body`, \r\nI can't pass the option just like:\r\n```\r\napp.use(log4js.koaLogger(log4js.getLogger(\"http\"), { level: 'auto',\r\n    tokens: [\r\n        { token: ':body', replacement: ctx.request.body}\r\n    ],\r\n    format: ':remote-addr - -' +\r\n    ' \":method :url HTTP/:http-version\"' +\r\n    ' :status :content-length \":referrer\"' +\r\n    ' \":user-agent\"' +\r\n    ' :body'\r\n}))\r\n```\r\nbecause ctx is not defined here.\r\n\r\nI can use a wrapper, but is there any simple way to solve this problem?"}}
{"actor":{"display_login":"fancyoung"}}