{"action":"created","issue":{"url":"https://api.github.com/repos/apache/brooklyn-server/issues/940","repository_url":"https://api.github.com/repos/apache/brooklyn-server","labels_url":"https://api.github.com/repos/apache/brooklyn-server/issues/940/labels{/name}","comments_url":"https://api.github.com/repos/apache/brooklyn-server/issues/940/comments","events_url":"https://api.github.com/repos/apache/brooklyn-server/issues/940/events","html_url":"https://github.com/apache/brooklyn-server/pull/940","id":290898615,"number":940,"title":"Add mapped diagnostic context with entity ids to logs","user":{"login":"geomacy","id":14142759,"avatar_url":"https://avatars2.githubusercontent.com/u/14142759?v=4","gravatar_id":"","url":"https://api.github.com/users/geomacy","html_url":"https://github.com/geomacy","followers_url":"https://api.github.com/users/geomacy/followers","following_url":"https://api.github.com/users/geomacy/following{/other_user}","gists_url":"https://api.github.com/users/geomacy/gists{/gist_id}","starred_url":"https://api.github.com/users/geomacy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geomacy/subscriptions","organizations_url":"https://api.github.com/users/geomacy/orgs","repos_url":"https://api.github.com/users/geomacy/repos","events_url":"https://api.github.com/users/geomacy/events{/privacy}","received_events_url":"https://api.github.com/users/geomacy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-01-23T16:17:52Z","updated_at":"2018-02-15T10:47:36Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/brooklyn-server/pulls/940","html_url":"https://github.com/apache/brooklyn-server/pull/940","diff_url":"https://github.com/apache/brooklyn-server/pull/940.diff","patch_url":"https://github.com/apache/brooklyn-server/pull/940.patch"},"body":"Adds a mapped diagnostic context to (some) log messages.\r\n\r\nBasically if a task has a context entity this adds a field to log messages with both the task id and a list of the ids of the entity and its ancestors up to the application. For example in the output from the `ApplicationLoggingTest` below, with an application with a child and grandchild, we get\r\n\r\n```\r\n2018-02-02 18:00:39,351 INFO  xJTIhVuy-[ixxmgfzjos,m5it71jfiw,kw18pflnqp]     Hello from entity kw18pflnqp\r\n2018-02-02 18:00:39,354 INFO  hqSMSJKm-[ixxmgfzjos,m5it71jfiw]   Hello from entity m5it71jfiw\r\n2018-02-02 18:00:39,354 INFO  fCW0mP92-[ixxmgfzjos] Hello world\r\n2018-02-02 18:00:39,365 INFO  - Stop task id is nxLdBOiG\r\n2018-02-02 18:00:39,366 INFO  nxLdBOiG-[ixxmgfzjos] Goodbye cruel world\r\n2018-02-02 18:00:39,367 INFO  hniq2zjE-[ixxmgfzjos,m5it71jfiw]   Goodbye from entity m5it71jfiw\r\n2018-02-02 18:00:39,369 INFO  cFmqxDkJ-[ixxmgfzjos,m5it71jfiw,kw18pflnqp]     Goodbye from entity kw18pflnqp\r\n```\r\n\r\nThis is basically a \"proof of concept\" to add entity ids to related logs.  Will remove the Do Not Merge after doing some more code review comment updates.\r\n\r\nAlso while the output from this change does add entity ids into a good number of log messages, there are other messages  where the ids don't get added.  These are probably going through paths in the code that aren't addressed here.  Nevertheless I think this is worth putting up for people to look at.\r\n\r\nThis also contains an update to `LogWatcher` so that it can make assertions on the _formatted_ output from the `PatternLayoutAppender`. \r\n\r\nMerge with https://github.com/apache/brooklyn-dist/pull/117"},"comment":{"url":"https://api.github.com/repos/apache/brooklyn-server/issues/comments/365890694","html_url":"https://github.com/apache/brooklyn-server/pull/940#issuecomment-365890694","issue_url":"https://api.github.com/repos/apache/brooklyn-server/issues/940","id":365890694,"user":{"login":"tbouron","id":2082759,"avatar_url":"https://avatars3.githubusercontent.com/u/2082759?v=4","gravatar_id":"","url":"https://api.github.com/users/tbouron","html_url":"https://github.com/tbouron","followers_url":"https://api.github.com/users/tbouron/followers","following_url":"https://api.github.com/users/tbouron/following{/other_user}","gists_url":"https://api.github.com/users/tbouron/gists{/gist_id}","starred_url":"https://api.github.com/users/tbouron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbouron/subscriptions","organizations_url":"https://api.github.com/users/tbouron/orgs","repos_url":"https://api.github.com/users/tbouron/repos","events_url":"https://api.github.com/users/tbouron/events{/privacy}","received_events_url":"https://api.github.com/users/tbouron/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T10:47:36Z","updated_at":"2018-02-15T10:47:36Z","author_association":"CONTRIBUTOR","body":"Tested, works as advertised. All comments from @ahgittin have been addressed and I have to say, it's really cool to have this extra information @geomacy 🎉 👍 \r\n\r\nMerging"}}
{"actor":{"display_login":"tbouron"}}