{"action":"opened","issue":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/898","labels_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/898/labels{/name}","comments_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/898/comments","events_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/898/events","html_url":"https://github.com/dropwizard/dropwizard/issues/898","id":58847278,"number":898,"title":"Request Logs do not provide valid user field","user":{"login":"abuchanan920","id":368793,"avatar_url":"https://avatars.githubusercontent.com/u/368793?v=3","gravatar_id":"","url":"https://api.github.com/users/abuchanan920","html_url":"https://github.com/abuchanan920","followers_url":"https://api.github.com/users/abuchanan920/followers","following_url":"https://api.github.com/users/abuchanan920/following{/other_user}","gists_url":"https://api.github.com/users/abuchanan920/gists{/gist_id}","starred_url":"https://api.github.com/users/abuchanan920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abuchanan920/subscriptions","organizations_url":"https://api.github.com/users/abuchanan920/orgs","repos_url":"https://api.github.com/users/abuchanan920/repos","events_url":"https://api.github.com/users/abuchanan920/events{/privacy}","received_events_url":"https://api.github.com/users/abuchanan920/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-25T04:05:09Z","updated_at":"2015-02-25T04:05:09Z","closed_at":null,"body":"It seems that the authentication schemes of Jetty and Dropwizard don't communicate enough information for the request logs to include the user field.\r\n\r\nThe user field would definitely be useful for identifying how much usage was being generated by different api users or identifying which users are still using an older version of the api so they can be targeted for upgrade, etc.\r\n\r\nIt looks like io.dropwizard.jetty.Slf4jRequestLog extends org.eclipse.jetty.server.AbstractNCSARequestLog which does the actual creation of the message.\r\n\r\nIn that class we see:\r\n```\r\n            Authentication authentication = request.getAuthentication();\r\n            if (authentication instanceof Authentication.User)\r\n                buf.append(((Authentication.User)authentication).getUserIdentity().getUserPrincipal().getName());\r\n            else\r\n                buf.append(\" - \");\r\n```\r\n\r\nIn all of my logs, I only ever see \"-\" for the user, although dropwizard basic authentication seems to be working correctly. I can't find anywhere in the code where it attempts to push the user info back into the Jetty world for logging to work correctly though.\r\n\r\nAm I missing something?\r\n\r\nThanks!\r\nAndrew"}}