{"action":"closed","number":12682,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/12682","id":25643583,"html_url":"https://github.com/owncloud/core/pull/12682","diff_url":"https://github.com/owncloud/core/pull/12682.diff","patch_url":"https://github.com/owncloud/core/pull/12682.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/12682","number":12682,"state":"closed","locked":false,"title":"Dump Arrays, Objects and Exceptions to the log","user":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"body":"By using a 3rd party normalizer, it's possible to dump objects and arrays to the log, without having to pre-encode them.\r\n\r\nThe library used in this PR is : https://github.com/interfasys/lognormalizer\r\n\r\nYou add the variables to the context array like this:\r\n```\r\n$this->logger->debug(\"Here is what's inside this FileInfo object: {fileinfo}\", array(\r\n\t'app' => 'myApp',\r\n\t'fileinfo' => $fileInfo,\r\n));\r\n```\r\nor\r\n```\r\ntry {\r\n\tthrow new \\Exception(\"I want to be logged as an Exception!\");\r\n} catch (\\Exception $e) {\r\n\t$this->logger->debug(\"I'm logging the full Exception object here: {exception}\", array(\r\n\t\t'app' => 'myApp',\r\n\t\t'exception' => $e,\r\n\t));\r\n}\r\n```\r\n\r\n_Note: It has only been tested with the ownlcloud logger (log_type)._\r\n","created_at":"2014-12-08T03:18:24Z","updated_at":"2015-09-24T16:27:51Z","closed_at":"2015-09-24T16:27:51Z","merged_at":null,"merge_commit_sha":"5a02168b0538336d8a9fbe67368b616dba1a9aa8","assignee":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/37","html_url":"https://github.com/owncloud/core/milestones/8.2-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/37/labels","id":993629,"number":37,"title":"8.2-current","description":"","creator":{"login":"craigpg","id":160667,"avatar_url":"https://avatars.githubusercontent.com/u/160667?v=3","gravatar_id":"","url":"https://api.github.com/users/craigpg","html_url":"https://github.com/craigpg","followers_url":"https://api.github.com/users/craigpg/followers","following_url":"https://api.github.com/users/craigpg/following{/other_user}","gists_url":"https://api.github.com/users/craigpg/gists{/gist_id}","starred_url":"https://api.github.com/users/craigpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigpg/subscriptions","organizations_url":"https://api.github.com/users/craigpg/orgs","repos_url":"https://api.github.com/users/craigpg/repos","events_url":"https://api.github.com/users/craigpg/events{/privacy}","received_events_url":"https://api.github.com/users/craigpg/received_events","type":"User","site_admin":false},"open_issues":206,"closed_issues":942,"state":"open","created_at":"2015-02-24T16:19:37Z","updated_at":"2015-09-24T16:27:51Z","due_on":"2015-10-20T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/core/pulls/12682/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/12682/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/12682/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/70ebdd32f676dcb7c6c3aed4029596332402b995","head":{"label":"oparoz:smarter-logger","ref":"smarter-logger","sha":"70ebdd32f676dcb7c6c3aed4029596332402b995","user":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"repo":{"id":23593901,"name":"core","full_name":"oparoz/core","owner":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oparoz/core","description":"The ownCloud core","fork":true,"url":"https://api.github.com/repos/oparoz/core","forks_url":"https://api.github.com/repos/oparoz/core/forks","keys_url":"https://api.github.com/repos/oparoz/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oparoz/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oparoz/core/teams","hooks_url":"https://api.github.com/repos/oparoz/core/hooks","issue_events_url":"https://api.github.com/repos/oparoz/core/issues/events{/number}","events_url":"https://api.github.com/repos/oparoz/core/events","assignees_url":"https://api.github.com/repos/oparoz/core/assignees{/user}","branches_url":"https://api.github.com/repos/oparoz/core/branches{/branch}","tags_url":"https://api.github.com/repos/oparoz/core/tags","blobs_url":"https://api.github.com/repos/oparoz/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oparoz/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oparoz/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/oparoz/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oparoz/core/statuses/{sha}","languages_url":"https://api.github.com/repos/oparoz/core/languages","stargazers_url":"https://api.github.com/repos/oparoz/core/stargazers","contributors_url":"https://api.github.com/repos/oparoz/core/contributors","subscribers_url":"https://api.github.com/repos/oparoz/core/subscribers","subscription_url":"https://api.github.com/repos/oparoz/core/subscription","commits_url":"https://api.github.com/repos/oparoz/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/oparoz/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/oparoz/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/oparoz/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/oparoz/core/contents/{+path}","compare_url":"https://api.github.com/repos/oparoz/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oparoz/core/merges","archive_url":"https://api.github.com/repos/oparoz/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oparoz/core/downloads","issues_url":"https://api.github.com/repos/oparoz/core/issues{/number}","pulls_url":"https://api.github.com/repos/oparoz/core/pulls{/number}","milestones_url":"https://api.github.com/repos/oparoz/core/milestones{/number}","notifications_url":"https://api.github.com/repos/oparoz/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oparoz/core/labels{/name}","releases_url":"https://api.github.com/repos/oparoz/core/releases{/id}","created_at":"2014-09-02T20:10:47Z","updated_at":"2015-04-27T19:10:42Z","pushed_at":"2015-09-14T12:47:36Z","git_url":"git://github.com/oparoz/core.git","ssh_url":"git@github.com:oparoz/core.git","clone_url":"https://github.com/oparoz/core.git","svn_url":"https://github.com/oparoz/core","homepage":null,"size":197191,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"owncloud:master","ref":"master","sha":"1369525e7f6b9676062fa6b04d012f4ec7f5e693","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-09-24T16:15:04Z","pushed_at":"2015-09-24T16:26:45Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":"https://owncloud.org/","size":1135373,"stargazers_count":3680,"watchers_count":3680,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1172,"mirror_url":null,"open_issues_count":1950,"forks":1172,"open_issues":1950,"watchers":3680,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/12682"},"html":{"href":"https://github.com/owncloud/core/pull/12682"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/12682"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/12682/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/12682/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/12682/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/70ebdd32f676dcb7c6c3aed4029596332402b995"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":25,"review_comments":16,"commits":1,"additions":14,"deletions":1,"changed_files":1}}