{"action":"created","comment":{"url":"https://api.github.com/repos/serilog-web/classic/pulls/comments/38609331","id":38609331,"diff_hunk":"@@ -133,31 +136,41 @@ public static LogEventLevel FormDataLoggingLevel\n         /// <param name=\"context\">An <see cref=\"T:System.Web.HttpApplication\"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application </param>\n         public void Init(HttpApplication context)\n         {\n-            context.LogRequest += LogRequest;\n-            context.Error += Error;\n-        }\n+            context.BeginRequest += (o, args) =>\n+            {\n+                context.Context.Items[StopWatchKey] = Stopwatch.StartNew();","path":"src/SerilogWeb.Classic/Classic/ApplicationLifecycleModule.cs","position":26,"original_position":26,"commit_id":"a9bf552414aa0ce474ee0193053eb100cb2d2b5c","original_commit_id":"a9bf552414aa0ce474ee0193053eb100cb2d2b5c","user":{"login":"nblumhardt","id":342712,"avatar_url":"https://avatars.githubusercontent.com/u/342712?v=3","gravatar_id":"","url":"https://api.github.com/users/nblumhardt","html_url":"https://github.com/nblumhardt","followers_url":"https://api.github.com/users/nblumhardt/followers","following_url":"https://api.github.com/users/nblumhardt/following{/other_user}","gists_url":"https://api.github.com/users/nblumhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/nblumhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nblumhardt/subscriptions","organizations_url":"https://api.github.com/users/nblumhardt/orgs","repos_url":"https://api.github.com/users/nblumhardt/repos","events_url":"https://api.github.com/users/nblumhardt/events{/privacy}","received_events_url":"https://api.github.com/users/nblumhardt/received_events","type":"User","site_admin":false},"body":"May be better not to kick this off if the module is not enabled (and conditionally check again in EndRequest in case the key isn't present).","created_at":"2015-09-03T02:59:21Z","updated_at":"2015-09-03T02:59:21Z","html_url":"https://github.com/serilog-web/classic/pull/16#discussion_r38609331","pull_request_url":"https://api.github.com/repos/serilog-web/classic/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/serilog-web/classic/pulls/comments/38609331"},"html":{"href":"https://github.com/serilog-web/classic/pull/16#discussion_r38609331"},"pull_request":{"href":"https://api.github.com/repos/serilog-web/classic/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/serilog-web/classic/pulls/16","id":42519818,"html_url":"https://github.com/serilog-web/classic/pull/16","diff_url":"https://github.com/serilog-web/classic/pull/16.diff","patch_url":"https://github.com/serilog-web/classic/pull/16.patch","issue_url":"https://api.github.com/repos/serilog-web/classic/issues/16","number":16,"state":"open","locked":false,"title":"Include Response Time in Log Module","user":{"login":"mattgwagner","id":157644,"avatar_url":"https://avatars.githubusercontent.com/u/157644?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgwagner","html_url":"https://github.com/mattgwagner","followers_url":"https://api.github.com/users/mattgwagner/followers","following_url":"https://api.github.com/users/mattgwagner/following{/other_user}","gists_url":"https://api.github.com/users/mattgwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgwagner/subscriptions","organizations_url":"https://api.github.com/users/mattgwagner/orgs","repos_url":"https://api.github.com/users/mattgwagner/repos","events_url":"https://api.github.com/users/mattgwagner/events{/privacy}","received_events_url":"https://api.github.com/users/mattgwagner/received_events","type":"User","site_admin":false},"body":"Refactor the `ApplicationLifecycleModule` to use Begin/EndRequest hooks and record the elapsed request time in milliseconds as part of the log.\r\n\r\nI based this on some code from Phil Haack and also this blog (http://www.mikevalenty.com/a-custom-httpmodule-to-log-request-duration/). There might be a more optimized way to do this, but it might meet the general use case.","created_at":"2015-08-15T14:14:12Z","updated_at":"2015-09-03T02:59:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"668b7c63b7da4af79766a3ba83249817a9e7072d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/serilog-web/classic/pulls/16/commits","review_comments_url":"https://api.github.com/repos/serilog-web/classic/pulls/16/comments","review_comment_url":"https://api.github.com/repos/serilog-web/classic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serilog-web/classic/issues/16/comments","statuses_url":"https://api.github.com/repos/serilog-web/classic/statuses/a9bf552414aa0ce474ee0193053eb100cb2d2b5c","head":{"label":"mattgwagner:include_response_time","ref":"include_response_time","sha":"a9bf552414aa0ce474ee0193053eb100cb2d2b5c","user":{"login":"mattgwagner","id":157644,"avatar_url":"https://avatars.githubusercontent.com/u/157644?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgwagner","html_url":"https://github.com/mattgwagner","followers_url":"https://api.github.com/users/mattgwagner/followers","following_url":"https://api.github.com/users/mattgwagner/following{/other_user}","gists_url":"https://api.github.com/users/mattgwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgwagner/subscriptions","organizations_url":"https://api.github.com/users/mattgwagner/orgs","repos_url":"https://api.github.com/users/mattgwagner/repos","events_url":"https://api.github.com/users/mattgwagner/events{/privacy}","received_events_url":"https://api.github.com/users/mattgwagner/received_events","type":"User","site_admin":false},"repo":{"id":40722139,"name":"classic","full_name":"mattgwagner/classic","owner":{"login":"mattgwagner","id":157644,"avatar_url":"https://avatars.githubusercontent.com/u/157644?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgwagner","html_url":"https://github.com/mattgwagner","followers_url":"https://api.github.com/users/mattgwagner/followers","following_url":"https://api.github.com/users/mattgwagner/following{/other_user}","gists_url":"https://api.github.com/users/mattgwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgwagner/subscriptions","organizations_url":"https://api.github.com/users/mattgwagner/orgs","repos_url":"https://api.github.com/users/mattgwagner/repos","events_url":"https://api.github.com/users/mattgwagner/events{/privacy}","received_events_url":"https://api.github.com/users/mattgwagner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattgwagner/classic","description":"Serilog web request logging and enrichment for classic ASP.NET applications","fork":true,"url":"https://api.github.com/repos/mattgwagner/classic","forks_url":"https://api.github.com/repos/mattgwagner/classic/forks","keys_url":"https://api.github.com/repos/mattgwagner/classic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattgwagner/classic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattgwagner/classic/teams","hooks_url":"https://api.github.com/repos/mattgwagner/classic/hooks","issue_events_url":"https://api.github.com/repos/mattgwagner/classic/issues/events{/number}","events_url":"https://api.github.com/repos/mattgwagner/classic/events","assignees_url":"https://api.github.com/repos/mattgwagner/classic/assignees{/user}","branches_url":"https://api.github.com/repos/mattgwagner/classic/branches{/branch}","tags_url":"https://api.github.com/repos/mattgwagner/classic/tags","blobs_url":"https://api.github.com/repos/mattgwagner/classic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattgwagner/classic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattgwagner/classic/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattgwagner/classic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattgwagner/classic/statuses/{sha}","languages_url":"https://api.github.com/repos/mattgwagner/classic/languages","stargazers_url":"https://api.github.com/repos/mattgwagner/classic/stargazers","contributors_url":"https://api.github.com/repos/mattgwagner/classic/contributors","subscribers_url":"https://api.github.com/repos/mattgwagner/classic/subscribers","subscription_url":"https://api.github.com/repos/mattgwagner/classic/subscription","commits_url":"https://api.github.com/repos/mattgwagner/classic/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattgwagner/classic/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattgwagner/classic/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattgwagner/classic/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattgwagner/classic/contents/{+path}","compare_url":"https://api.github.com/repos/mattgwagner/classic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattgwagner/classic/merges","archive_url":"https://api.github.com/repos/mattgwagner/classic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattgwagner/classic/downloads","issues_url":"https://api.github.com/repos/mattgwagner/classic/issues{/number}","pulls_url":"https://api.github.com/repos/mattgwagner/classic/pulls{/number}","milestones_url":"https://api.github.com/repos/mattgwagner/classic/milestones{/number}","notifications_url":"https://api.github.com/repos/mattgwagner/classic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattgwagner/classic/labels{/name}","releases_url":"https://api.github.com/repos/mattgwagner/classic/releases{/id}","created_at":"2015-08-14T15:28:27Z","updated_at":"2015-08-14T15:28:27Z","pushed_at":"2015-08-18T14:22:17Z","git_url":"git://github.com/mattgwagner/classic.git","ssh_url":"git@github.com:mattgwagner/classic.git","clone_url":"https://github.com/mattgwagner/classic.git","svn_url":"https://github.com/mattgwagner/classic","homepage":"","size":158,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"serilog-web:master","ref":"master","sha":"8eaec7a7b1d8f0ff528e775428c95442aaaae426","user":{"login":"serilog-web","id":11831106,"avatar_url":"https://avatars.githubusercontent.com/u/11831106?v=3","gravatar_id":"","url":"https://api.github.com/users/serilog-web","html_url":"https://github.com/serilog-web","followers_url":"https://api.github.com/users/serilog-web/followers","following_url":"https://api.github.com/users/serilog-web/following{/other_user}","gists_url":"https://api.github.com/users/serilog-web/gists{/gist_id}","starred_url":"https://api.github.com/users/serilog-web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serilog-web/subscriptions","organizations_url":"https://api.github.com/users/serilog-web/orgs","repos_url":"https://api.github.com/users/serilog-web/repos","events_url":"https://api.github.com/users/serilog-web/events{/privacy}","received_events_url":"https://api.github.com/users/serilog-web/received_events","type":"Organization","site_admin":false},"repo":{"id":33528816,"name":"classic","full_name":"serilog-web/classic","owner":{"login":"serilog-web","id":11831106,"avatar_url":"https://avatars.githubusercontent.com/u/11831106?v=3","gravatar_id":"","url":"https://api.github.com/users/serilog-web","html_url":"https://github.com/serilog-web","followers_url":"https://api.github.com/users/serilog-web/followers","following_url":"https://api.github.com/users/serilog-web/following{/other_user}","gists_url":"https://api.github.com/users/serilog-web/gists{/gist_id}","starred_url":"https://api.github.com/users/serilog-web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serilog-web/subscriptions","organizations_url":"https://api.github.com/users/serilog-web/orgs","repos_url":"https://api.github.com/users/serilog-web/repos","events_url":"https://api.github.com/users/serilog-web/events{/privacy}","received_events_url":"https://api.github.com/users/serilog-web/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serilog-web/classic","description":"Serilog web request logging and enrichment for classic ASP.NET applications","fork":false,"url":"https://api.github.com/repos/serilog-web/classic","forks_url":"https://api.github.com/repos/serilog-web/classic/forks","keys_url":"https://api.github.com/repos/serilog-web/classic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serilog-web/classic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serilog-web/classic/teams","hooks_url":"https://api.github.com/repos/serilog-web/classic/hooks","issue_events_url":"https://api.github.com/repos/serilog-web/classic/issues/events{/number}","events_url":"https://api.github.com/repos/serilog-web/classic/events","assignees_url":"https://api.github.com/repos/serilog-web/classic/assignees{/user}","branches_url":"https://api.github.com/repos/serilog-web/classic/branches{/branch}","tags_url":"https://api.github.com/repos/serilog-web/classic/tags","blobs_url":"https://api.github.com/repos/serilog-web/classic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serilog-web/classic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serilog-web/classic/git/refs{/sha}","trees_url":"https://api.github.com/repos/serilog-web/classic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serilog-web/classic/statuses/{sha}","languages_url":"https://api.github.com/repos/serilog-web/classic/languages","stargazers_url":"https://api.github.com/repos/serilog-web/classic/stargazers","contributors_url":"https://api.github.com/repos/serilog-web/classic/contributors","subscribers_url":"https://api.github.com/repos/serilog-web/classic/subscribers","subscription_url":"https://api.github.com/repos/serilog-web/classic/subscription","commits_url":"https://api.github.com/repos/serilog-web/classic/commits{/sha}","git_commits_url":"https://api.github.com/repos/serilog-web/classic/git/commits{/sha}","comments_url":"https://api.github.com/repos/serilog-web/classic/comments{/number}","issue_comment_url":"https://api.github.com/repos/serilog-web/classic/issues/comments{/number}","contents_url":"https://api.github.com/repos/serilog-web/classic/contents/{+path}","compare_url":"https://api.github.com/repos/serilog-web/classic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serilog-web/classic/merges","archive_url":"https://api.github.com/repos/serilog-web/classic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serilog-web/classic/downloads","issues_url":"https://api.github.com/repos/serilog-web/classic/issues{/number}","pulls_url":"https://api.github.com/repos/serilog-web/classic/pulls{/number}","milestones_url":"https://api.github.com/repos/serilog-web/classic/milestones{/number}","notifications_url":"https://api.github.com/repos/serilog-web/classic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serilog-web/classic/labels{/name}","releases_url":"https://api.github.com/repos/serilog-web/classic/releases{/id}","created_at":"2015-04-07T07:33:23Z","updated_at":"2015-08-19T16:23:30Z","pushed_at":"2015-08-18T21:46:13Z","git_url":"git://github.com/serilog-web/classic.git","ssh_url":"git@github.com:serilog-web/classic.git","clone_url":"https://github.com/serilog-web/classic.git","svn_url":"https://github.com/serilog-web/classic","homepage":"","size":373,"stargazers_count":7,"watchers_count":7,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serilog-web/classic/pulls/16"},"html":{"href":"https://github.com/serilog-web/classic/pull/16"},"issue":{"href":"https://api.github.com/repos/serilog-web/classic/issues/16"},"comments":{"href":"https://api.github.com/repos/serilog-web/classic/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/serilog-web/classic/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/serilog-web/classic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serilog-web/classic/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/serilog-web/classic/statuses/a9bf552414aa0ce474ee0193053eb100cb2d2b5c"}}}}