{"id":234,"date":"2020-10-12T12:26:25","date_gmt":"2020-10-12T11:26:25","guid":{"rendered":"http:\/\/blog.c-hase.de\/?p=234"},"modified":"2020-10-12T12:26:25","modified_gmt":"2020-10-12T11:26:25","slug":"log4net-and-configsource","status":"publish","type":"post","link":"http:\/\/blog.c-hase.de\/?p=234","title":{"rendered":"log4net and configSource"},"content":{"rendered":"<p>https:\/\/stackoverflow.com\/questions\/445976\/log4net-config-in-external-file-does-not-work<\/p>\n<div class=\"js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center\" data-value=\"113\">113<\/div>\n<div class=\"js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4\" tabindex=\"0\" title=\"Loading when this answer was accepted\u2026\" role=\"note\" data-s-tooltip-placement=\"right\" aria-label=\"Accepted\"><\/div>\n<div class=\"s-prose js-post-body\">\n<p>Do you have the following attribute in your <code>AssemblyInfo.cs<\/code> file:<\/p>\n<pre><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = \"Log4Net.config\", Watch = true)]\r\n<\/code><\/pre>\n<p>and code like this at the start of each class that requires logging functionality:<\/p>\n<pre><code>private static readonly ILog log = \r\nLogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);\r\n<\/code><\/pre>\n<p>I have a blog post containing this and other info <a href=\"http:\/\/mitch-wheat.blogspot.com\/2007\/04\/log4net-net-logging-tool.html\" rel=\"noreferrer\">here<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/stackoverflow.com\/questions\/445976\/log4net-config-in-external-file-does-not-work 113 Do you have the following attribute in your AssemblyInfo.cs file: [assembly: log4net.Config.XmlConfigurator(ConfigFile = &#8222;Log4Net.config&#8220;, Watch = true)] and code like this at the start of each class that requires logging functionality: private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); &hellip; <a href=\"http:\/\/blog.c-hase.de\/?p=234\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=\/wp\/v2\/posts\/234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=234"}],"version-history":[{"count":1,"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=\/wp\/v2\/posts\/234\/revisions"}],"predecessor-version":[{"id":235,"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=\/wp\/v2\/posts\/234\/revisions\/235"}],"wp:attachment":[{"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.c-hase.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}