{"action":"created","issue":{"url":"https://api.github.com/repos/yesodweb/wai/issues/496","labels_url":"https://api.github.com/repos/yesodweb/wai/issues/496/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/wai/issues/496/comments","events_url":"https://api.github.com/repos/yesodweb/wai/issues/496/events","html_url":"https://github.com/yesodweb/wai/issues/496","id":123478989,"number":496,"title":"wai request logger middleware does not catch all exceptions","user":{"login":"mwotton","id":68482,"avatar_url":"https://avatars.githubusercontent.com/u/68482?v=3","gravatar_id":"","url":"https://api.github.com/users/mwotton","html_url":"https://github.com/mwotton","followers_url":"https://api.github.com/users/mwotton/followers","following_url":"https://api.github.com/users/mwotton/following{/other_user}","gists_url":"https://api.github.com/users/mwotton/gists{/gist_id}","starred_url":"https://api.github.com/users/mwotton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwotton/subscriptions","organizations_url":"https://api.github.com/users/mwotton/orgs","repos_url":"https://api.github.com/users/mwotton/repos","events_url":"https://api.github.com/users/mwotton/events{/privacy}","received_events_url":"https://api.github.com/users/mwotton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-22T13:10:57Z","updated_at":"2015-12-26T22:10:27Z","closed_at":null,"body":"```\r\nimport           Network.Wai.Handler.Warp\r\nimport           Network.Wai.Middleware.RequestLogger\r\n\r\nmain :: IO ()\r\nmain = run 3000 $  logStdoutDev $ appLogsOk\r\n\r\n\r\nappLogsOk _ respond = respond (throw $ userError \"baby did a bad bad thing\")\r\nappNoLog _ respond = throw $ userError \"baby did a bad bad thing\"\r\n```\r\n\r\nThe first one logs the incoming request, the second one doesn't. (Obviously this is terrible code, but it's derived from a problem I had in a servant webapp, and not seeing the incoming request in the logs made it a lot harder to debug.)"},"comment":{"url":"https://api.github.com/repos/yesodweb/wai/issues/comments/167367306","html_url":"https://github.com/yesodweb/wai/issues/496#issuecomment-167367306","issue_url":"https://api.github.com/repos/yesodweb/wai/issues/496","id":167367306,"user":{"login":"fizruk","id":686582,"avatar_url":"https://avatars.githubusercontent.com/u/686582?v=3","gravatar_id":"","url":"https://api.github.com/users/fizruk","html_url":"https://github.com/fizruk","followers_url":"https://api.github.com/users/fizruk/followers","following_url":"https://api.github.com/users/fizruk/following{/other_user}","gists_url":"https://api.github.com/users/fizruk/gists{/gist_id}","starred_url":"https://api.github.com/users/fizruk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fizruk/subscriptions","organizations_url":"https://api.github.com/users/fizruk/orgs","repos_url":"https://api.github.com/users/fizruk/repos","events_url":"https://api.github.com/users/fizruk/events{/privacy}","received_events_url":"https://api.github.com/users/fizruk/received_events","type":"User","site_admin":false},"created_at":"2015-12-26T22:10:26Z","updated_at":"2015-12-26T22:10:26Z","body":"I have just bumped into this when an SQL exception didn't result in a request log entry.\r\nLuckily, I've been able to reproduce the bug and find out the reason quite quickly.\r\n\r\nNonetheless, missing log entry was very unexpected.\r\n\r\n@snoyberg how do you think real world apps should go about internal error logs? Do you suggest that it should keep track of all of its possible sources of exceptions and keep a separate log for that?\r\n\r\n@mwotton do you need any help on this?"}}