{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/31121","repository_url":"https://api.github.com/repos/owncloud/core","labels_url":"https://api.github.com/repos/owncloud/core/issues/31121/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/31121/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/31121/events","html_url":"https://github.com/owncloud/core/pull/31121","id":314106931,"number":31121,"title":"Ability to log extra fields + trigger event when logging","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"labels":[{"id":17709846,"url":"https://api.github.com/repos/owncloud/core/labels/3%20-%20To%20Review","name":"3 - To Review","color":"ededed","default":false},{"id":132150275,"url":"https://api.github.com/repos/owncloud/core/labels/backport-request","name":"backport-request","color":"006b75","default":false},{"id":298283285,"url":"https://api.github.com/repos/owncloud/core/labels/p2-high","name":"p2-high","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"assignees":[{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/120","html_url":"https://github.com/owncloud/core/milestone/120","labels_url":"https://api.github.com/repos/owncloud/core/milestones/120/labels","id":3031526,"number":120,"title":"development","description":"10.0.9","creator":{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"open_issues":144,"closed_issues":14,"state":"open","created_at":"2018-01-12T14:07:35Z","updated_at":"2018-04-13T13:27:14Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-04-13T13:27:14Z","updated_at":"2018-04-13T14:37:24Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/31121","html_url":"https://github.com/owncloud/core/pull/31121","diff_url":"https://github.com/owncloud/core/pull/31121.diff","patch_url":"https://github.com/owncloud/core/pull/31121.patch"},"body":"## Description\r\n1) If a logger supports it like the default logger, additional fields can\r\nnow be added to the base JSON object.\r\n\r\nBuilt to still support old loggers so this shouldn't break any API contracts.\r\n\r\n2) Trigger an event before and after logging an entry, independently from log level\r\n\r\nThis makes it possible for apps to react on log events.\r\nCould also help with the testing app to capture log entries.\r\n\r\n## Related Issue\r\nNone\r\n\r\n## Motivation and Context\r\nSome log analyzers prefer to have the fields directly appearing in the base JSON object instead of serialized into strings.\r\n\r\n## How Has This Been Tested?\r\nAdd `\\OC::$server->getLogger()->error(\"Test extra fields\", ['app' => 'test', 'extraFields' => ['hello' => 'field', 'another' => 'field']]);` to Sabre\\Directory constructor and open the web UI.\r\nThen check the logs:\r\n```\r\n{\"reqId\":\"S9ulvAzpHQcTLEtVRMPf\",\"level\":3,\"time\":\"2018-04-13T13:22:51+00:00\",\"remoteAddr\":\"127.0.0.1\",\"user\":\"admin\",\"app\":\"test\",\"method\":\"PROPFIND\",\"url\":\"\\/owncloud\\/remote.php\\/webdav\\/\",\"message\":\"Test extra fields\",\"hello\":\"field\",\"another\":\"field\"}\r\n```\r\n\r\n## Screenshots (if appropriate):\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [x] I have read the **CONTRIBUTING** document.\r\n- [ ] I have added tests to cover my changes.\r\n- [x] All new and existing tests passed.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/381155853","html_url":"https://github.com/owncloud/core/pull/31121#issuecomment-381155853","issue_url":"https://api.github.com/repos/owncloud/core/issues/31121","id":381155853,"user":{"login":"butonic","id":956847,"avatar_url":"https://avatars0.githubusercontent.com/u/956847?v=4","gravatar_id":"","url":"https://api.github.com/users/butonic","html_url":"https://github.com/butonic","followers_url":"https://api.github.com/users/butonic/followers","following_url":"https://api.github.com/users/butonic/following{/other_user}","gists_url":"https://api.github.com/users/butonic/gists{/gist_id}","starred_url":"https://api.github.com/users/butonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butonic/subscriptions","organizations_url":"https://api.github.com/users/butonic/orgs","repos_url":"https://api.github.com/users/butonic/repos","events_url":"https://api.github.com/users/butonic/events{/privacy}","received_events_url":"https://api.github.com/users/butonic/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T14:37:24Z","updated_at":"2018-04-13T14:37:24Z","author_association":"OWNER","body":"- [ ] allow syslog logger to log these extra attributes? see https://github.com/owncloud/core/pull/31124"}}
{"actor":{"display_login":"butonic"}}