{"action":"created","issue":{"url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/issues/87","repository_url":"https://api.github.com/repos/serilog/serilog-sinks-splunk","labels_url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/issues/87/comments","events_url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/issues/87/events","html_url":"https://github.com/serilog/serilog-sinks-splunk/issues/87","id":303172148,"number":87,"title":"Support for Sink config from appsettings.json","user":{"login":"alastairtree","id":6273429,"avatar_url":"https://avatars2.githubusercontent.com/u/6273429?v=4","gravatar_id":"","url":"https://api.github.com/users/alastairtree","html_url":"https://github.com/alastairtree","followers_url":"https://api.github.com/users/alastairtree/followers","following_url":"https://api.github.com/users/alastairtree/following{/other_user}","gists_url":"https://api.github.com/users/alastairtree/gists{/gist_id}","starred_url":"https://api.github.com/users/alastairtree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alastairtree/subscriptions","organizations_url":"https://api.github.com/users/alastairtree/orgs","repos_url":"https://api.github.com/users/alastairtree/repos","events_url":"https://api.github.com/users/alastairtree/events{/privacy}","received_events_url":"https://api.github.com/users/alastairtree/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/milestones/4","html_url":"https://github.com/serilog/serilog-sinks-splunk/milestone/4","labels_url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/milestones/4/labels","id":3302889,"number":4,"title":"3.0","description":null,"creator":{"login":"merbla","id":637298,"avatar_url":"https://avatars0.githubusercontent.com/u/637298?v=4","gravatar_id":"","url":"https://api.github.com/users/merbla","html_url":"https://github.com/merbla","followers_url":"https://api.github.com/users/merbla/followers","following_url":"https://api.github.com/users/merbla/following{/other_user}","gists_url":"https://api.github.com/users/merbla/gists{/gist_id}","starred_url":"https://api.github.com/users/merbla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merbla/subscriptions","organizations_url":"https://api.github.com/users/merbla/orgs","repos_url":"https://api.github.com/users/merbla/repos","events_url":"https://api.github.com/users/merbla/events{/privacy}","received_events_url":"https://api.github.com/users/merbla/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":3,"state":"open","created_at":"2018-04-27T00:02:15Z","updated_at":"2018-05-02T05:38:49Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-03-07T16:40:52Z","updated_at":"2018-05-02T05:38:49Z","closed_at":"2018-05-02T05:38:49Z","author_association":"NONE","body":"Hello - thanks for the library.\r\n\r\nI was wondering if you support reading the sink config from the configuration files using Serilog.Settings.Configuration? I can't seem to get the code below to add the sink? Am I doing it wrong or is it not supported? Or could you point me to some docs?\r\n\r\nappsettings.json\r\n```\r\n\"WriteTo\": [\r\n      {\r\n          \"Name\": \"EventCollector\",\r\n          \"Args\": {\r\n             \"splunkHost\": \"https://myhost/services/collector\",\r\n             \"eventCollectorToken\": \"0000\"\r\n          }\r\n       }\r\n    ],\r\n```\r\n\r\nprogram.cs\r\n```\r\nLog.Logger = new LoggerConfiguration()\r\n                .ReadFrom.Configuration(configuration)\r\n                .CreateLogger();\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/issues/comments/385869932","html_url":"https://github.com/serilog/serilog-sinks-splunk/issues/87#issuecomment-385869932","issue_url":"https://api.github.com/repos/serilog/serilog-sinks-splunk/issues/87","id":385869932,"user":{"login":"merbla","id":637298,"avatar_url":"https://avatars0.githubusercontent.com/u/637298?v=4","gravatar_id":"","url":"https://api.github.com/users/merbla","html_url":"https://github.com/merbla","followers_url":"https://api.github.com/users/merbla/followers","following_url":"https://api.github.com/users/merbla/following{/other_user}","gists_url":"https://api.github.com/users/merbla/gists{/gist_id}","starred_url":"https://api.github.com/users/merbla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merbla/subscriptions","organizations_url":"https://api.github.com/users/merbla/orgs","repos_url":"https://api.github.com/users/merbla/repos","events_url":"https://api.github.com/users/merbla/events{/privacy}","received_events_url":"https://api.github.com/users/merbla/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T05:38:49Z","updated_at":"2018-05-02T05:38:49Z","author_association":"CONTRIBUTOR","body":"@alastairtree there is a working version of this in #92.  \r\n\r\nWhat you have above seems correct.  Make sure that your `appsetting.json` is available\r\n\r\n```csharp\r\nvar configuration = new ConfigurationBuilder()\r\n    .SetBasePath(Directory.GetCurrentDirectory())\r\n    .AddJsonFile(\"appsettings.json\")\r\n    .Build();\r\n\r\nLog.Logger = new LoggerConfiguration()\r\n    .ReadFrom.Configuration(configuration)\r\n    .CreateLogger();\r\n```\r\n\r\n```javascript\r\n{\r\n    \"Serilog\": {\r\n        \"Using\": [\"Serilog.Sinks.Console\", \"Serilog.Sinks.Splunk\"],\r\n        \"MinimumLevel\": \"Information\",\r\n        \"WriteTo\": [{\r\n                \"Name\": \"Console\"\r\n            },\r\n            {\r\n                \"Name\": \"EventCollector\",\r\n                \"Args\": {\r\n                    \"splunkHost\": \"http://splunk:8088\",\r\n                    \"eventCollectorToken\": \"00112233-4455-6677-8899-AABBCCDDEEFF\"\r\n                }\r\n            }\r\n        ],\r\n        \"Properties\": {\r\n            \"Application\": \"Serilog Splunk Console Sample\",\r\n            \"Serilog.Sinks.Splunk.Sample\": \"ViaEventCollector\",\r\n            \"Serilog.Sinks.Splunk.Sample.TestType\": \"AppSettings.json\"\r\n        }\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"merbla"}}