{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/38","repository_url":"https://api.github.com/repos/OfficeDev/PnP","labels_url":"https://api.github.com/repos/OfficeDev/PnP/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP/issues/38/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP/issues/38/events","html_url":"https://github.com/OfficeDev/PnP/pull/38","id":40581435,"number":38,"title":"Logging improvements","user":{"login":"sgryphon","id":339293,"avatar_url":"https://avatars.githubusercontent.com/u/339293?v=3","gravatar_id":"","url":"https://api.github.com/users/sgryphon","html_url":"https://github.com/sgryphon","followers_url":"https://api.github.com/users/sgryphon/followers","following_url":"https://api.github.com/users/sgryphon/following{/other_user}","gists_url":"https://api.github.com/users/sgryphon/gists{/gist_id}","starred_url":"https://api.github.com/users/sgryphon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgryphon/subscriptions","organizations_url":"https://api.github.com/users/sgryphon/orgs","repos_url":"https://api.github.com/users/sgryphon/repos","events_url":"https://api.github.com/users/sgryphon/events{/privacy}","received_events_url":"https://api.github.com/users/sgryphon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2014-08-19T11:29:53Z","updated_at":"2016-07-27T15:55:27Z","closed_at":"2014-08-19T12:23:38Z","pull_request":{"url":"https://api.github.com/repos/OfficeDev/PnP/pulls/38","html_url":"https://github.com/OfficeDev/PnP/pull/38","diff_url":"https://github.com/OfficeDev/PnP/pull/38.diff","patch_url":"https://github.com/OfficeDev/PnP/pull/38.patch"},"body":"Error logging was pretty rough, e.g. hard coded to write to the console (even if, for example, running in a web application).\r\n\r\nI have changed it to use the standard .NET Framework System.Diagnostics with a named TraceSource \"OfficeDevPnP.Core\".\r\n\r\nTracing should generally be an internal system, however it was public so I have kept the old behaviour (marked Obsolete), including automatically configuring writing to the console if needed. This means that all existing samples should continue to operate the same (with slightly different output format). (It also probably shouldn't be a partial class, but I have left that for now as well).\r\n\r\nUsing TraceSource means the level of diagnostics can be configured and directed to the console, ASP.NET trace, or other listeners (including third part like log4net or NLog). These changes will give a good base for moving forward, adding things like activity scopes and correlation IDs.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/comments/235631195","html_url":"https://github.com/OfficeDev/PnP/pull/38#issuecomment-235631195","issue_url":"https://api.github.com/repos/OfficeDev/PnP/issues/38","id":235631195,"user":{"login":"seriewe","id":10572013,"avatar_url":"https://avatars.githubusercontent.com/u/10572013?v=3","gravatar_id":"","url":"https://api.github.com/users/seriewe","html_url":"https://github.com/seriewe","followers_url":"https://api.github.com/users/seriewe/followers","following_url":"https://api.github.com/users/seriewe/following{/other_user}","gists_url":"https://api.github.com/users/seriewe/gists{/gist_id}","starred_url":"https://api.github.com/users/seriewe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seriewe/subscriptions","organizations_url":"https://api.github.com/users/seriewe/orgs","repos_url":"https://api.github.com/users/seriewe/repos","events_url":"https://api.github.com/users/seriewe/events{/privacy}","received_events_url":"https://api.github.com/users/seriewe/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T15:55:26Z","updated_at":"2016-07-27T15:55:26Z","body":"Hello,\r\ncan you please share some Config examples how I can Route the PnP loggs to NLog?\r\n\r\nI'm able to log the Output of my own logger and the PnP logs to a File, but then I see just the PnP logs inside the Debug output window. As soon as I add a Console target to the NLog config, I get a StackOverflow Exception.\r\n\r\nThis is my web.config:\r\n <sectionGroup name=\"pnp\">\r\n      <section name=\"tracing\" type=\"OfficeDevPnP.Core.Diagnostics.LogConfigurationTracingSection, OfficeDevPnP.Core\" \r\n               allowLocation=\"true\" \r\n               allowDefinition=\"Everywhere\" />\r\n    </sectionGroup>\r\n  <!-- Start logging / Errorlogging -->\r\n  <pnp>\r\n    <tracing logLevel=\"Debug\">\r\n      <logger type=\"OfficeDevPnP.Core.Diagnostics.TraceLogger, OfficeDevPnP.Core, Culture=neutral, PublicKeyToken=null\" />\r\n    </tracing>\r\n  </pnp>\r\n  <system.diagnostics>\r\n        <sharedListeners>\r\n            <add name=\"NLogTraceListener\" type=\"NLog.NLogTraceListener, NLog\" />\r\n            <!--<add name=\"console\" type=\"System.Diagnostics.ConsoleTraceListener\" />-->\r\n        </sharedListeners>\r\n        <sources>\r\n            <source name=\"OfficeDevPnP.Core\" switchValue=\"All\">\r\n                <listeners>\r\n                    <add name=\"NLogTraceListener\" type=\"NLog.NLogTraceListener, NLog\" />\r\n                </listeners>\r\n            </source>\r\n          </sources>\r\n        <!--<trace indentsize=\"2\" autoflush=\"true\">\r\n            <listeners>\r\n                --><!--<add name=\"console\" />--><!--\r\n                --><!--<add name=\"NLogTraceListener\" />--><!--\r\n            </listeners>\r\n        </trace>-->\r\n    </system.diagnostics>    \r\n  <!-- End logging / Errorlogging -->\r\n\r\nAnd a part of my NLog.config:\r\n <logger name=\"*\" minlevel=\"Debug\" writeTo=\"FileLogs\" />\r\n  <logger name=\"*\" minlevel=\"Debug\" writeTo=\"console\" />\r\n\r\nI did different combinations of listener source and so one, but I don't figure out how to log to the File and also have the output inside the output window inside VS.\r\n\r\nThanks ;)"}}
{"actor":{"display_login":"seriewe"}}