{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2984","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2984/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2984/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2984/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2984","id":301616158,"number":2984,"title":"Configurable LogEntry creation with logback appender","user":{"login":"favila","id":1603620,"avatar_url":"https://avatars2.githubusercontent.com/u/1603620?v=4","gravatar_id":"","url":"https://api.github.com/users/favila","html_url":"https://github.com/favila","followers_url":"https://api.github.com/users/favila/followers","following_url":"https://api.github.com/users/favila/following{/other_user}","gists_url":"https://api.github.com/users/favila/gists{/gist_id}","starred_url":"https://api.github.com/users/favila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/favila/subscriptions","organizations_url":"https://api.github.com/users/favila/orgs","repos_url":"https://api.github.com/users/favila/repos","events_url":"https://api.github.com/users/favila/events{/privacy}","received_events_url":"https://api.github.com/users/favila/received_events","type":"User","site_admin":false},"labels":[{"id":175662188,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/labels/cla:%20yes","name":"cla: yes","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-02T00:59:40Z","updated_at":"2018-03-06T00:48:36Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2984","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2984","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2984.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2984.patch"},"body":"This adds a knob to the Logback Appender that allows the user to customize how a `LogEntry` is built from an `ILoggingEvent`. My motivation was I wanted to log the logger name, but the `LoggingEnhancer` interface does not have access to the original log event.\r\n\r\nThe implementation strategy is similar to `LoggingEnhancer`. I created an interface `ILoggingEventTransformer` which accepts an `ILoggingEvent` and must return a `LogEntry.Builder` which may be passed through Enhancers. `logback.xml` can supply the classname of (only one!) logging event transformer via `<transformer>`.\r\n\r\nI also refactored the existing `LogEntry`-building code (mostly the `logEntryFor()` private method) out of `LoggingAppender` into `StringPayloadTransformer` and a static class of utility functions.\r\n\r\nThis also makes it easy to use payloads other than strings (e.g. jsonPayload) for structured logging, which should satisfy #2669. I include an example of this approach in `TestJsonPayloadTransformer`.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/comments/370620779","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2984#issuecomment-370620779","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2984","id":370620779,"user":{"login":"pongad","id":1617025,"avatar_url":"https://avatars1.githubusercontent.com/u/1617025?v=4","gravatar_id":"","url":"https://api.github.com/users/pongad","html_url":"https://github.com/pongad","followers_url":"https://api.github.com/users/pongad/followers","following_url":"https://api.github.com/users/pongad/following{/other_user}","gists_url":"https://api.github.com/users/pongad/gists{/gist_id}","starred_url":"https://api.github.com/users/pongad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pongad/subscriptions","organizations_url":"https://api.github.com/users/pongad/orgs","repos_url":"https://api.github.com/users/pongad/repos","events_url":"https://api.github.com/users/pongad/events{/privacy}","received_events_url":"https://api.github.com/users/pongad/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T00:48:36Z","updated_at":"2018-03-06T00:48:36Z","author_association":"CONTRIBUTOR","body":"@jabubake Do you want to take a look?"}}
{"actor":{"display_login":"pongad"}}