{"action":"created","issue":{"url":"https://api.github.com/repos/NLog/NLog/issues/1551","repository_url":"https://api.github.com/repos/NLog/NLog","labels_url":"https://api.github.com/repos/NLog/NLog/issues/1551/labels{/name}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/1551/comments","events_url":"https://api.github.com/repos/NLog/NLog/issues/1551/events","html_url":"https://github.com/NLog/NLog/pull/1551","id":167082813,"number":1551,"title":"Add CompoundLayout","user":{"login":"luigiberrettini","id":4513301,"avatar_url":"https://avatars.githubusercontent.com/u/4513301?v=3","gravatar_id":"","url":"https://api.github.com/users/luigiberrettini","html_url":"https://github.com/luigiberrettini","followers_url":"https://api.github.com/users/luigiberrettini/followers","following_url":"https://api.github.com/users/luigiberrettini/following{/other_user}","gists_url":"https://api.github.com/users/luigiberrettini/gists{/gist_id}","starred_url":"https://api.github.com/users/luigiberrettini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigiberrettini/subscriptions","organizations_url":"https://api.github.com/users/luigiberrettini/orgs","repos_url":"https://api.github.com/users/luigiberrettini/repos","events_url":"https://api.github.com/users/luigiberrettini/events{/privacy}","received_events_url":"https://api.github.com/users/luigiberrettini/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NLog/NLog/labels/feature","name":"feature","color":"02e10c"},{"url":"https://api.github.com/repos/NLog/NLog/labels/has%20unittests","name":"has unittests","color":"009800"},{"url":"https://api.github.com/repos/NLog/NLog/labels/needs%20documentation%20on%20wiki","name":"needs documentation on wiki","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/NLog/NLog/milestones/25","html_url":"https://github.com/NLog/NLog/milestones/4.3.6","labels_url":"https://api.github.com/repos/NLog/NLog/milestones/25/labels","id":1822261,"number":25,"title":"4.3.6","description":"","creator":{"login":"304NotModified","id":5808377,"avatar_url":"https://avatars.githubusercontent.com/u/5808377?v=3","gravatar_id":"","url":"https://api.github.com/users/304NotModified","html_url":"https://github.com/304NotModified","followers_url":"https://api.github.com/users/304NotModified/followers","following_url":"https://api.github.com/users/304NotModified/following{/other_user}","gists_url":"https://api.github.com/users/304NotModified/gists{/gist_id}","starred_url":"https://api.github.com/users/304NotModified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/304NotModified/subscriptions","organizations_url":"https://api.github.com/users/304NotModified/orgs","repos_url":"https://api.github.com/users/304NotModified/repos","events_url":"https://api.github.com/users/304NotModified/events{/privacy}","received_events_url":"https://api.github.com/users/304NotModified/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":8,"state":"open","created_at":"2016-06-12T18:11:43Z","updated_at":"2016-07-23T19:13:15Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-07-22T16:27:18Z","updated_at":"2016-07-23T19:50:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NLog/NLog/pulls/1551","html_url":"https://github.com/NLog/NLog/pull/1551","diff_url":"https://github.com/NLog/NLog/pull/1551.diff","patch_url":"https://github.com/NLog/NLog/pull/1551.patch"},"body":"As per issue #1543 I added a CompoundLayout Layout to make it possible to use multiple nested heterogeneous layouts and create complex log entries.\r\n\r\nTake as an example the following configuration:\r\n```xml\r\n<nlog>\r\n  <targets>\r\n    <target name='file' type='File' fileName='log.txt'>\r\n      <layout type='CompoundLayout'>\r\n        <layout type='SimpleLayout' text=\"myAmazingText: \" />\r\n        <layout type='JsonLayout'>\r\n          <attribute name='time' layout='${longdate}' />\r\n          <attribute name='level' layout='${level:upperCase=true}'/>\r\n          <attribute name='nested' encode='false'  >\r\n            <layout type='JsonLayout'>\r\n              <attribute name='message' layout='${message}' />\r\n              <attribute name='exception' layout='${exception}' />\r\n            </layout>\r\n          </attribute>\r\n        </layout>\r\n      </layout>\r\n    </target>\r\n  </targets>\r\n  <rules>\r\n  </rules>\r\n</nlog>\r\n```\r\n\r\nLog entries would be like this:\r\n```json\r\nmyAmazingText: { \"time\": \"2016-10-30 13:30:55.0000\", \"level\": \"INFO\", \"nested\": { \"message\": \"this is message\", \"exception\": \"test\" } }\r\n```"},"comment":{"url":"https://api.github.com/repos/NLog/NLog/issues/comments/234736713","html_url":"https://github.com/NLog/NLog/pull/1551#issuecomment-234736713","issue_url":"https://api.github.com/repos/NLog/NLog/issues/1551","id":234736713,"user":{"login":"luigiberrettini","id":4513301,"avatar_url":"https://avatars.githubusercontent.com/u/4513301?v=3","gravatar_id":"","url":"https://api.github.com/users/luigiberrettini","html_url":"https://github.com/luigiberrettini","followers_url":"https://api.github.com/users/luigiberrettini/followers","following_url":"https://api.github.com/users/luigiberrettini/following{/other_user}","gists_url":"https://api.github.com/users/luigiberrettini/gists{/gist_id}","starred_url":"https://api.github.com/users/luigiberrettini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigiberrettini/subscriptions","organizations_url":"https://api.github.com/users/luigiberrettini/orgs","repos_url":"https://api.github.com/users/luigiberrettini/repos","events_url":"https://api.github.com/users/luigiberrettini/events{/privacy}","received_events_url":"https://api.github.com/users/luigiberrettini/received_events","type":"User","site_admin":false},"created_at":"2016-07-23T19:50:40Z","updated_at":"2016-07-23T19:50:40Z","body":"I just added the documentation.\r\n\r\nhttps://github.com/NLog/NLog/wiki/Layouts\r\n(I suppose the NuGet badge will auto-update to 4.3.6 when you release it)\r\n\r\nhttps://github.com/NLog/NLog/wiki/CompoundLayout"}}
{"actor":{"display_login":"luigiberrettini"}}