{"action":"opened","number":5,"pull_request":{"url":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/5","id":227574467,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NTc0NDY3","html_url":"https://github.com/iMacTia/lograge-sql/pull/5","diff_url":"https://github.com/iMacTia/lograge-sql/pull/5.diff","patch_url":"https://github.com/iMacTia/lograge-sql/pull/5.patch","issue_url":"https://api.github.com/repos/iMacTia/lograge-sql/issues/5","number":5,"state":"open","locked":false,"title":"Adding event extraction & formatter customization","user":{"login":"Al-un","id":40738601,"node_id":"MDQ6VXNlcjQwNzM4NjAx","avatar_url":"https://avatars0.githubusercontent.com/u/40738601?v=4","gravatar_id":"","url":"https://api.github.com/users/Al-un","html_url":"https://github.com/Al-un","followers_url":"https://api.github.com/users/Al-un/followers","following_url":"https://api.github.com/users/Al-un/following{/other_user}","gists_url":"https://api.github.com/users/Al-un/gists{/gist_id}","starred_url":"https://api.github.com/users/Al-un/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Al-un/subscriptions","organizations_url":"https://api.github.com/users/Al-un/orgs","repos_url":"https://api.github.com/users/Al-un/repos","events_url":"https://api.github.com/users/Al-un/events{/privacy}","received_events_url":"https://api.github.com/users/Al-un/received_events","type":"User","site_admin":false},"body":"When `lograge-sql` works well when Lograge raw format is used, it might not be convenient to have a concatenated string when using Lograge JSON format. More globally, this suggestion allows a bit of flexibility:\r\n\r\n- Log output can be customized via a formatter\r\n- The formatter is fed by a event extractor. This allows user to extract additional fields (e.g. `payload[:cached]`\r\n- Such customization are accessible via a Railtie. If no configuration is done, it works as currently defined and this change is completely invisible\r\n\r\n<sub>Being a Ruby beginner, feel free to correct the code</sub>\r\n\r\n---\r\nFor reference, ActiveRecord default event extractor and formatter:\r\nhttps://www.rubydoc.info/gems/activerecord/ActiveRecord/LogSubscriber#sql-instance_method","created_at":"2018-11-01T10:28:36Z","updated_at":"2018-11-01T10:28:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/5/commits","review_comments_url":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/5/comments","review_comment_url":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iMacTia/lograge-sql/issues/5/comments","statuses_url":"https://api.github.com/repos/iMacTia/lograge-sql/statuses/726ec7eb6c704877f6ada2a957428813e096321e","head":{"label":"Al-un:master","ref":"master","sha":"726ec7eb6c704877f6ada2a957428813e096321e","user":{"login":"Al-un","id":40738601,"node_id":"MDQ6VXNlcjQwNzM4NjAx","avatar_url":"https://avatars0.githubusercontent.com/u/40738601?v=4","gravatar_id":"","url":"https://api.github.com/users/Al-un","html_url":"https://github.com/Al-un","followers_url":"https://api.github.com/users/Al-un/followers","following_url":"https://api.github.com/users/Al-un/following{/other_user}","gists_url":"https://api.github.com/users/Al-un/gists{/gist_id}","starred_url":"https://api.github.com/users/Al-un/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Al-un/subscriptions","organizations_url":"https://api.github.com/users/Al-un/orgs","repos_url":"https://api.github.com/users/Al-un/repos","events_url":"https://api.github.com/users/Al-un/events{/privacy}","received_events_url":"https://api.github.com/users/Al-un/received_events","type":"User","site_admin":false},"repo":{"id":155627637,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU2Mjc2Mzc=","name":"lograge-sql","full_name":"Al-un/lograge-sql","private":false,"owner":{"login":"Al-un","id":40738601,"node_id":"MDQ6VXNlcjQwNzM4NjAx","avatar_url":"https://avatars0.githubusercontent.com/u/40738601?v=4","gravatar_id":"","url":"https://api.github.com/users/Al-un","html_url":"https://github.com/Al-un","followers_url":"https://api.github.com/users/Al-un/followers","following_url":"https://api.github.com/users/Al-un/following{/other_user}","gists_url":"https://api.github.com/users/Al-un/gists{/gist_id}","starred_url":"https://api.github.com/users/Al-un/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Al-un/subscriptions","organizations_url":"https://api.github.com/users/Al-un/orgs","repos_url":"https://api.github.com/users/Al-un/repos","events_url":"https://api.github.com/users/Al-un/events{/privacy}","received_events_url":"https://api.github.com/users/Al-un/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Al-un/lograge-sql","description":"A Lograge extension to include SQL queries in your requests log","fork":true,"url":"https://api.github.com/repos/Al-un/lograge-sql","forks_url":"https://api.github.com/repos/Al-un/lograge-sql/forks","keys_url":"https://api.github.com/repos/Al-un/lograge-sql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Al-un/lograge-sql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Al-un/lograge-sql/teams","hooks_url":"https://api.github.com/repos/Al-un/lograge-sql/hooks","issue_events_url":"https://api.github.com/repos/Al-un/lograge-sql/issues/events{/number}","events_url":"https://api.github.com/repos/Al-un/lograge-sql/events","assignees_url":"https://api.github.com/repos/Al-un/lograge-sql/assignees{/user}","branches_url":"https://api.github.com/repos/Al-un/lograge-sql/branches{/branch}","tags_url":"https://api.github.com/repos/Al-un/lograge-sql/tags","blobs_url":"https://api.github.com/repos/Al-un/lograge-sql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Al-un/lograge-sql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Al-un/lograge-sql/git/refs{/sha}","trees_url":"https://api.github.com/repos/Al-un/lograge-sql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Al-un/lograge-sql/statuses/{sha}","languages_url":"https://api.github.com/repos/Al-un/lograge-sql/languages","stargazers_url":"https://api.github.com/repos/Al-un/lograge-sql/stargazers","contributors_url":"https://api.github.com/repos/Al-un/lograge-sql/contributors","subscribers_url":"https://api.github.com/repos/Al-un/lograge-sql/subscribers","subscription_url":"https://api.github.com/repos/Al-un/lograge-sql/subscription","commits_url":"https://api.github.com/repos/Al-un/lograge-sql/commits{/sha}","git_commits_url":"https://api.github.com/repos/Al-un/lograge-sql/git/commits{/sha}","comments_url":"https://api.github.com/repos/Al-un/lograge-sql/comments{/number}","issue_comment_url":"https://api.github.com/repos/Al-un/lograge-sql/issues/comments{/number}","contents_url":"https://api.github.com/repos/Al-un/lograge-sql/contents/{+path}","compare_url":"https://api.github.com/repos/Al-un/lograge-sql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Al-un/lograge-sql/merges","archive_url":"https://api.github.com/repos/Al-un/lograge-sql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Al-un/lograge-sql/downloads","issues_url":"https://api.github.com/repos/Al-un/lograge-sql/issues{/number}","pulls_url":"https://api.github.com/repos/Al-un/lograge-sql/pulls{/number}","milestones_url":"https://api.github.com/repos/Al-un/lograge-sql/milestones{/number}","notifications_url":"https://api.github.com/repos/Al-un/lograge-sql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Al-un/lograge-sql/labels{/name}","releases_url":"https://api.github.com/repos/Al-un/lograge-sql/releases{/id}","deployments_url":"https://api.github.com/repos/Al-un/lograge-sql/deployments","created_at":"2018-10-31T21:48:33Z","updated_at":"2018-11-01T10:19:34Z","pushed_at":"2018-11-01T10:19:32Z","git_url":"git://github.com/Al-un/lograge-sql.git","ssh_url":"git@github.com:Al-un/lograge-sql.git","clone_url":"https://github.com/Al-un/lograge-sql.git","svn_url":"https://github.com/Al-un/lograge-sql","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"iMacTia:master","ref":"master","sha":"3df31907460db7019cbe8b81c1ee22f41b8de611","user":{"login":"iMacTia","id":2527520,"node_id":"MDQ6VXNlcjI1Mjc1MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/2527520?v=4","gravatar_id":"","url":"https://api.github.com/users/iMacTia","html_url":"https://github.com/iMacTia","followers_url":"https://api.github.com/users/iMacTia/followers","following_url":"https://api.github.com/users/iMacTia/following{/other_user}","gists_url":"https://api.github.com/users/iMacTia/gists{/gist_id}","starred_url":"https://api.github.com/users/iMacTia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iMacTia/subscriptions","organizations_url":"https://api.github.com/users/iMacTia/orgs","repos_url":"https://api.github.com/users/iMacTia/repos","events_url":"https://api.github.com/users/iMacTia/events{/privacy}","received_events_url":"https://api.github.com/users/iMacTia/received_events","type":"User","site_admin":false},"repo":{"id":63409559,"node_id":"MDEwOlJlcG9zaXRvcnk2MzQwOTU1OQ==","name":"lograge-sql","full_name":"iMacTia/lograge-sql","private":false,"owner":{"login":"iMacTia","id":2527520,"node_id":"MDQ6VXNlcjI1Mjc1MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/2527520?v=4","gravatar_id":"","url":"https://api.github.com/users/iMacTia","html_url":"https://github.com/iMacTia","followers_url":"https://api.github.com/users/iMacTia/followers","following_url":"https://api.github.com/users/iMacTia/following{/other_user}","gists_url":"https://api.github.com/users/iMacTia/gists{/gist_id}","starred_url":"https://api.github.com/users/iMacTia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iMacTia/subscriptions","organizations_url":"https://api.github.com/users/iMacTia/orgs","repos_url":"https://api.github.com/users/iMacTia/repos","events_url":"https://api.github.com/users/iMacTia/events{/privacy}","received_events_url":"https://api.github.com/users/iMacTia/received_events","type":"User","site_admin":false},"html_url":"https://github.com/iMacTia/lograge-sql","description":"A Lograge extension to include SQL queries in your requests log","fork":false,"url":"https://api.github.com/repos/iMacTia/lograge-sql","forks_url":"https://api.github.com/repos/iMacTia/lograge-sql/forks","keys_url":"https://api.github.com/repos/iMacTia/lograge-sql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iMacTia/lograge-sql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iMacTia/lograge-sql/teams","hooks_url":"https://api.github.com/repos/iMacTia/lograge-sql/hooks","issue_events_url":"https://api.github.com/repos/iMacTia/lograge-sql/issues/events{/number}","events_url":"https://api.github.com/repos/iMacTia/lograge-sql/events","assignees_url":"https://api.github.com/repos/iMacTia/lograge-sql/assignees{/user}","branches_url":"https://api.github.com/repos/iMacTia/lograge-sql/branches{/branch}","tags_url":"https://api.github.com/repos/iMacTia/lograge-sql/tags","blobs_url":"https://api.github.com/repos/iMacTia/lograge-sql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iMacTia/lograge-sql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iMacTia/lograge-sql/git/refs{/sha}","trees_url":"https://api.github.com/repos/iMacTia/lograge-sql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iMacTia/lograge-sql/statuses/{sha}","languages_url":"https://api.github.com/repos/iMacTia/lograge-sql/languages","stargazers_url":"https://api.github.com/repos/iMacTia/lograge-sql/stargazers","contributors_url":"https://api.github.com/repos/iMacTia/lograge-sql/contributors","subscribers_url":"https://api.github.com/repos/iMacTia/lograge-sql/subscribers","subscription_url":"https://api.github.com/repos/iMacTia/lograge-sql/subscription","commits_url":"https://api.github.com/repos/iMacTia/lograge-sql/commits{/sha}","git_commits_url":"https://api.github.com/repos/iMacTia/lograge-sql/git/commits{/sha}","comments_url":"https://api.github.com/repos/iMacTia/lograge-sql/comments{/number}","issue_comment_url":"https://api.github.com/repos/iMacTia/lograge-sql/issues/comments{/number}","contents_url":"https://api.github.com/repos/iMacTia/lograge-sql/contents/{+path}","compare_url":"https://api.github.com/repos/iMacTia/lograge-sql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iMacTia/lograge-sql/merges","archive_url":"https://api.github.com/repos/iMacTia/lograge-sql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iMacTia/lograge-sql/downloads","issues_url":"https://api.github.com/repos/iMacTia/lograge-sql/issues{/number}","pulls_url":"https://api.github.com/repos/iMacTia/lograge-sql/pulls{/number}","milestones_url":"https://api.github.com/repos/iMacTia/lograge-sql/milestones{/number}","notifications_url":"https://api.github.com/repos/iMacTia/lograge-sql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iMacTia/lograge-sql/labels{/name}","releases_url":"https://api.github.com/repos/iMacTia/lograge-sql/releases{/id}","deployments_url":"https://api.github.com/repos/iMacTia/lograge-sql/deployments","created_at":"2016-07-15T09:25:23Z","updated_at":"2018-10-23T03:51:38Z","pushed_at":"2018-09-07T16:48:01Z","git_url":"git://github.com/iMacTia/lograge-sql.git","ssh_url":"git@github.com:iMacTia/lograge-sql.git","clone_url":"https://github.com/iMacTia/lograge-sql.git","svn_url":"https://github.com/iMacTia/lograge-sql","homepage":null,"size":11,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":7,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/5"},"html":{"href":"https://github.com/iMacTia/lograge-sql/pull/5"},"issue":{"href":"https://api.github.com/repos/iMacTia/lograge-sql/issues/5"},"comments":{"href":"https://api.github.com/repos/iMacTia/lograge-sql/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iMacTia/lograge-sql/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/iMacTia/lograge-sql/statuses/726ec7eb6c704877f6ada2a957428813e096321e"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":2,"additions":86,"deletions":3,"changed_files":5}}
{"actor":{"display_login":"Al-un"}}