{"action":"created","issue":{"url":"https://api.github.com/repos/stackify/stackify-api-dotnet/issues/3","labels_url":"https://api.github.com/repos/stackify/stackify-api-dotnet/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/stackify/stackify-api-dotnet/issues/3/comments","events_url":"https://api.github.com/repos/stackify/stackify-api-dotnet/issues/3/events","html_url":"https://github.com/stackify/stackify-api-dotnet/issues/3","id":107272681,"number":3,"title":"Direct api does not log according to the default example","user":{"login":"thomaseyde","id":504883,"avatar_url":"https://avatars.githubusercontent.com/u/504883?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaseyde","html_url":"https://github.com/thomaseyde","followers_url":"https://api.github.com/users/thomaseyde/followers","following_url":"https://api.github.com/users/thomaseyde/following{/other_user}","gists_url":"https://api.github.com/users/thomaseyde/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaseyde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaseyde/subscriptions","organizations_url":"https://api.github.com/users/thomaseyde/orgs","repos_url":"https://api.github.com/users/thomaseyde/repos","events_url":"https://api.github.com/users/thomaseyde/events{/privacy}","received_events_url":"https://api.github.com/users/thomaseyde/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-18T20:30:04Z","updated_at":"2015-09-18T21:43:47Z","closed_at":null,"body":"I am testing the direct api with NUnit tests and the test project's app.config contains the three required `appSettings` keys, but nothing is logged.\r\n\r\nI installed the nuget package.\r\n\r\nThere are a few calls on `Logger` which should read the api key, but that doesn't happen. The internal HttpClient should even read the api key when it's not given, but doesn't.\r\n\r\nThe only way I have gotten the direct api to actually log, is to manually set the `ApiKey` and call `Shutdown()` at the end. I haven't seen any references to `Shutdown()` btw,\r\n\r\nHere are the things I have tried:\r\n\r\n    [TestFixture]\r\n    public class Log_to_stackify\r\n    {\r\n        [Test]\r\n        public void Api_key_is_not_read_from_config()\r\n        {\r\n            Logger.ApiKey.ShouldNotBeNull();\r\n        }\r\n\r\n        [Test]\r\n        public void Api_key_should_have_been_read_but_its_not()\r\n        {\r\n            Logger.CanSend();\r\n            Logger.ApiKey.ShouldNotBeNull();\r\n        }\r\n\r\n        [Test]\r\n        public void The_default_example_does_not_log_anything()\r\n        {\r\n            Logger.QueueException(new ApplicationException(\"Sky is falling\"));\r\n        }\r\n\r\n        [Test]\r\n        public void Must_set_api_key_manually_and_call_shutdown_in_order_to_log()\r\n        {\r\n            Logger.ApiKey = ConfigurationManager.AppSettings[\"Stackify.ApiKey\"];\r\n            Logger.QueueException(new ApplicationException(\"Sky is falling\"));\r\n            Logger.Shutdown();\r\n        }\r\n    }\r\n"},"comment":{"url":"https://api.github.com/repos/stackify/stackify-api-dotnet/issues/comments/141575987","html_url":"https://github.com/stackify/stackify-api-dotnet/issues/3#issuecomment-141575987","issue_url":"https://api.github.com/repos/stackify/stackify-api-dotnet/issues/3","id":141575987,"user":{"login":"sporty81","id":4369244,"avatar_url":"https://avatars.githubusercontent.com/u/4369244?v=3","gravatar_id":"","url":"https://api.github.com/users/sporty81","html_url":"https://github.com/sporty81","followers_url":"https://api.github.com/users/sporty81/followers","following_url":"https://api.github.com/users/sporty81/following{/other_user}","gists_url":"https://api.github.com/users/sporty81/gists{/gist_id}","starred_url":"https://api.github.com/users/sporty81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sporty81/subscriptions","organizations_url":"https://api.github.com/users/sporty81/orgs","repos_url":"https://api.github.com/users/sporty81/repos","events_url":"https://api.github.com/users/sporty81/events{/privacy}","received_events_url":"https://api.github.com/users/sporty81/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T21:43:46Z","updated_at":"2015-09-18T21:43:46Z","body":"Thanks for your feedback.\r\n\r\nThe library is optimized for asynchronous usage and background processing. Since the library is designed to be asynchronous, Shutdown() does have to be called to force everything to be flushed. LogClient is really the key class and calling shutdown forces it to flush the queue.\r\n\r\nWith log4net, as an example, we automatically catch the OnClose method and do the proper flushing. But if you are using the API directly we don't have any sort of automatically flushing built in without manually calling Shutdown.\r\n\r\nI'll update the example readme to include a note about this.\r\n\r\nWe don't really recommend using our Logger class directly for logging, but that does not mean you can't! We would suggest using NLog or log4net so you have more flexibility for logging to text files and such as well.\r\n\r\nLogger.ApiKey is meant as a way to override the config and really serves no purpose as a \"get\". I'll check in to why it doesn't work though.\r\n"}}