{"action":"created","comment":{"url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/comments/207598401","pull_request_review_id":143248461,"id":207598401,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzU5ODQwMQ==","diff_hunk":"@@ -10,32 +10,36 @@ const env = process.env.NODE_ENV || 'development';\n const config = require('../config/config.json')[env];\n \n const utilityService = require('../services/utilityService');\n+const logger = require('../modules/logger');\n \n module.exports = {\n \n     logRequest: function(req, res, next) {\n-    \tif (req.method == 'POST') {\n-    \t    const ipAddress = (\n-    \t                req.headers['x-forwarded-for'] \n-    \t                        && req.headers['x-forwarded-for'].split(',').pop())\n-    \t            || req.connection.remoteAddress\n-    \t            || req.socket.remoteAddress\n-    \t            || req.connection.socket.remoteAddress;\n+    \tconst ipAddress = (\n+    \t            req.headers['x-forwarded-for'] \n+    \t                    && req.headers['x-forwarded-for'].split(',').pop())\n+    \t        || req.connection.remoteAddress\n+    \t        || req.socket.remoteAddress\n+    \t        || req.connection.socket.remoteAddress;\n \n-    \t    const url = req.originalUrl;\n-    \t    const body = req.body;\n+    \tconst url = req.originalUrl;\n+    \tconst body = req.body;\n \n-    \t    console.log('POST IPAddress: ', ipAddress);\n-    \t    console.log('\\x1b[36m%s\\x1b[0m', 'Request URL:', url);\n-    \t    console.log('POST: ', body);\n-    \t    console.log('\\x1b[33m%s\\x1b[0m', '-----------------------------');\n+    \tlogger.info('IPAddress: ' + ipAddress);\n+    \tlogger.info('Request Method: ' + req.method);\n+    \tlogger.info('Request Url: ' + url);\n+    \tlogger.info('Request Body: ', body);","path":"middlewares/index.js","position":35,"original_position":35,"commit_id":"3deb4811c494bb9cc1812d8598424a39dc84c9d4","original_commit_id":"3deb4811c494bb9cc1812d8598424a39dc84c9d4","user":{"login":"varunon9","id":9805036,"node_id":"MDQ6VXNlcjk4MDUwMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/9805036?v=4","gravatar_id":"","url":"https://api.github.com/users/varunon9","html_url":"https://github.com/varunon9","followers_url":"https://api.github.com/users/varunon9/followers","following_url":"https://api.github.com/users/varunon9/following{/other_user}","gists_url":"https://api.github.com/users/varunon9/gists{/gist_id}","starred_url":"https://api.github.com/users/varunon9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunon9/subscriptions","organizations_url":"https://api.github.com/users/varunon9/orgs","repos_url":"https://api.github.com/users/varunon9/repos","events_url":"https://api.github.com/users/varunon9/events{/privacy}","received_events_url":"https://api.github.com/users/varunon9/received_events","type":"User","site_admin":false},"body":"i tried morgan printing same format as mentioned but then dropped it. This format is valid only for requestLogs and not others. Critical one i am already saving to db. It's your call though","created_at":"2018-08-03T16:23:55Z","updated_at":"2018-08-03T16:23:56Z","html_url":"https://github.com/gawdsnitkkr/sell-my-services-backend/pull/15#discussion_r207598401","pull_request_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/comments/207598401"},"html":{"href":"https://github.com/gawdsnitkkr/sell-my-services-backend/pull/15#discussion_r207598401"},"pull_request":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15"}},"in_reply_to_id":207597426},"pull_request":{"url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15","id":206052112,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MDUyMTEy","html_url":"https://github.com/gawdsnitkkr/sell-my-services-backend/pull/15","diff_url":"https://github.com/gawdsnitkkr/sell-my-services-backend/pull/15.diff","patch_url":"https://github.com/gawdsnitkkr/sell-my-services-backend/pull/15.patch","issue_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/15","number":15,"state":"open","locked":false,"title":"Issue 13- Logging and Issue 14- setup guide","user":{"login":"varunon9","id":9805036,"node_id":"MDQ6VXNlcjk4MDUwMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/9805036?v=4","gravatar_id":"","url":"https://api.github.com/users/varunon9","html_url":"https://github.com/varunon9","followers_url":"https://api.github.com/users/varunon9/followers","following_url":"https://api.github.com/users/varunon9/following{/other_user}","gists_url":"https://api.github.com/users/varunon9/gists{/gist_id}","starred_url":"https://api.github.com/users/varunon9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunon9/subscriptions","organizations_url":"https://api.github.com/users/varunon9/orgs","repos_url":"https://api.github.com/users/varunon9/repos","events_url":"https://api.github.com/users/varunon9/events{/privacy}","received_events_url":"https://api.github.com/users/varunon9/received_events","type":"User","site_admin":false},"body":"Pull Request to fix following issues-\r\nhttps://github.com/gawdsnitkkr/sell-my-services-backend/issues/13\r\nhttps://github.com/gawdsnitkkr/sell-my-services-backend/issues/14","created_at":"2018-08-03T14:43:58Z","updated_at":"2018-08-03T16:23:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6bbffc4fc4b1b977e4b448d407c87ef64d37b3f5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15/commits","review_comments_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15/comments","review_comment_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/15/comments","statuses_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/statuses/3deb4811c494bb9cc1812d8598424a39dc84c9d4","head":{"label":"gawdsnitkkr:13-enableLogging","ref":"13-enableLogging","sha":"3deb4811c494bb9cc1812d8598424a39dc84c9d4","user":{"login":"gawdsnitkkr","id":21137303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMTM3MzAz","avatar_url":"https://avatars0.githubusercontent.com/u/21137303?v=4","gravatar_id":"","url":"https://api.github.com/users/gawdsnitkkr","html_url":"https://github.com/gawdsnitkkr","followers_url":"https://api.github.com/users/gawdsnitkkr/followers","following_url":"https://api.github.com/users/gawdsnitkkr/following{/other_user}","gists_url":"https://api.github.com/users/gawdsnitkkr/gists{/gist_id}","starred_url":"https://api.github.com/users/gawdsnitkkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawdsnitkkr/subscriptions","organizations_url":"https://api.github.com/users/gawdsnitkkr/orgs","repos_url":"https://api.github.com/users/gawdsnitkkr/repos","events_url":"https://api.github.com/users/gawdsnitkkr/events{/privacy}","received_events_url":"https://api.github.com/users/gawdsnitkkr/received_events","type":"Organization","site_admin":false},"repo":{"id":142477452,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI0Nzc0NTI=","name":"sell-my-services-backend","full_name":"gawdsnitkkr/sell-my-services-backend","owner":{"login":"gawdsnitkkr","id":21137303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMTM3MzAz","avatar_url":"https://avatars0.githubusercontent.com/u/21137303?v=4","gravatar_id":"","url":"https://api.github.com/users/gawdsnitkkr","html_url":"https://github.com/gawdsnitkkr","followers_url":"https://api.github.com/users/gawdsnitkkr/followers","following_url":"https://api.github.com/users/gawdsnitkkr/following{/other_user}","gists_url":"https://api.github.com/users/gawdsnitkkr/gists{/gist_id}","starred_url":"https://api.github.com/users/gawdsnitkkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawdsnitkkr/subscriptions","organizations_url":"https://api.github.com/users/gawdsnitkkr/orgs","repos_url":"https://api.github.com/users/gawdsnitkkr/repos","events_url":"https://api.github.com/users/gawdsnitkkr/events{/privacy}","received_events_url":"https://api.github.com/users/gawdsnitkkr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gawdsnitkkr/sell-my-services-backend","description":"search and sell your services to nearby locations","fork":false,"url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend","forks_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/forks","keys_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/teams","hooks_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/hooks","issue_events_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/events{/number}","events_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/events","assignees_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/assignees{/user}","branches_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/branches{/branch}","tags_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/tags","blobs_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/languages","stargazers_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/stargazers","contributors_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/contributors","subscribers_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/subscribers","subscription_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/subscription","commits_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/contents/{+path}","compare_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/merges","archive_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/downloads","issues_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues{/number}","pulls_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/labels{/name}","releases_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/releases{/id}","deployments_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/deployments","created_at":"2018-07-26T18:12:32Z","updated_at":"2018-08-03T12:58:44Z","pushed_at":"2018-08-03T14:46:52Z","git_url":"git://github.com/gawdsnitkkr/sell-my-services-backend.git","ssh_url":"git@github.com:gawdsnitkkr/sell-my-services-backend.git","clone_url":"https://github.com/gawdsnitkkr/sell-my-services-backend.git","svn_url":"https://github.com/gawdsnitkkr/sell-my-services-backend","homepage":null,"size":61,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":2,"open_issues":9,"watchers":2,"default_branch":"master"}},"base":{"label":"gawdsnitkkr:master","ref":"master","sha":"b89c72a7eb3730dbb3df685ce6863527f044276a","user":{"login":"gawdsnitkkr","id":21137303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMTM3MzAz","avatar_url":"https://avatars0.githubusercontent.com/u/21137303?v=4","gravatar_id":"","url":"https://api.github.com/users/gawdsnitkkr","html_url":"https://github.com/gawdsnitkkr","followers_url":"https://api.github.com/users/gawdsnitkkr/followers","following_url":"https://api.github.com/users/gawdsnitkkr/following{/other_user}","gists_url":"https://api.github.com/users/gawdsnitkkr/gists{/gist_id}","starred_url":"https://api.github.com/users/gawdsnitkkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawdsnitkkr/subscriptions","organizations_url":"https://api.github.com/users/gawdsnitkkr/orgs","repos_url":"https://api.github.com/users/gawdsnitkkr/repos","events_url":"https://api.github.com/users/gawdsnitkkr/events{/privacy}","received_events_url":"https://api.github.com/users/gawdsnitkkr/received_events","type":"Organization","site_admin":false},"repo":{"id":142477452,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI0Nzc0NTI=","name":"sell-my-services-backend","full_name":"gawdsnitkkr/sell-my-services-backend","owner":{"login":"gawdsnitkkr","id":21137303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMTM3MzAz","avatar_url":"https://avatars0.githubusercontent.com/u/21137303?v=4","gravatar_id":"","url":"https://api.github.com/users/gawdsnitkkr","html_url":"https://github.com/gawdsnitkkr","followers_url":"https://api.github.com/users/gawdsnitkkr/followers","following_url":"https://api.github.com/users/gawdsnitkkr/following{/other_user}","gists_url":"https://api.github.com/users/gawdsnitkkr/gists{/gist_id}","starred_url":"https://api.github.com/users/gawdsnitkkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawdsnitkkr/subscriptions","organizations_url":"https://api.github.com/users/gawdsnitkkr/orgs","repos_url":"https://api.github.com/users/gawdsnitkkr/repos","events_url":"https://api.github.com/users/gawdsnitkkr/events{/privacy}","received_events_url":"https://api.github.com/users/gawdsnitkkr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gawdsnitkkr/sell-my-services-backend","description":"search and sell your services to nearby locations","fork":false,"url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend","forks_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/forks","keys_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/teams","hooks_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/hooks","issue_events_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/events{/number}","events_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/events","assignees_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/assignees{/user}","branches_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/branches{/branch}","tags_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/tags","blobs_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/languages","stargazers_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/stargazers","contributors_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/contributors","subscribers_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/subscribers","subscription_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/subscription","commits_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/contents/{+path}","compare_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/merges","archive_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/downloads","issues_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues{/number}","pulls_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/labels{/name}","releases_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/releases{/id}","deployments_url":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/deployments","created_at":"2018-07-26T18:12:32Z","updated_at":"2018-08-03T12:58:44Z","pushed_at":"2018-08-03T14:46:52Z","git_url":"git://github.com/gawdsnitkkr/sell-my-services-backend.git","ssh_url":"git@github.com:gawdsnitkkr/sell-my-services-backend.git","clone_url":"https://github.com/gawdsnitkkr/sell-my-services-backend.git","svn_url":"https://github.com/gawdsnitkkr/sell-my-services-backend","homepage":null,"size":61,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":2,"open_issues":9,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15"},"html":{"href":"https://github.com/gawdsnitkkr/sell-my-services-backend/pull/15"},"issue":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/15"},"comments":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/gawdsnitkkr/sell-my-services-backend/statuses/3deb4811c494bb9cc1812d8598424a39dc84c9d4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"varunon9"}}