{"id":3398,"date":"2012-05-17T13:31:42","date_gmt":"2012-05-17T04:31:42","guid":{"rendered":"https:\/\/www.pistolfly.com\/weblog\/?p=3398"},"modified":"2017-07-31T12:07:15","modified_gmt":"2017-07-31T03:07:15","slug":"chaging-log-output-destination-path-with-log4net","status":"publish","type":"post","link":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html","title":{"rendered":"Chaging log output destination path with log4net"},"content":{"rendered":"<pre class=\"prettyprint\">log4net.Repository.ILoggerRepository[] repositories = log4net.LogManager.GetAllRepositories();\r\nforeach (log4net.Repository.ILoggerRepository repository in repositories)\r\n{\r\n    foreach (log4net.Appender.IAppender appender in repository.GetAppenders())\r\n    {\r\n        log4net.Appender.FileAppender fileAppender = appender as log4net.Appender.FileAppender;\r\n        if (fileAppender != null)\r\n        {\r\n            appender.File = \"log.log\"; \/\/ Set log output destination path\r\n            appender.ActivateOptions();\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>* Although I have set File, I have to set File in configuration XML file.<\/p>\n<p><a href=\"http:\/\/dobon.net\/vb\/bbs\/log3-36\/22030.html\" target=\"_blank\">log4net\u3067\u8a2d\u5b9a\u3057\u305f\u30ed\u30b0\u51fa\u529b\u5148\u30d1\u30b9\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u53d6\u5f97: DOBON.NET\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u63b2\u793a\u677f\u904e\u53bb\u30ed\u30b0<\/a><br \/>\n<a href=\"http:\/\/www.atmarkit.co.jp\/bbs\/phpBB\/viewtopic.php?topic=30980&forum=7\" target=\"_blank\">log4net\u3067\u306e\u30ed\u30b0\u51fa\u529b\u306b\u3064\u3044\u3066 \uff0d Insider.NET \uff0d \uff20IT<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>log4net.Repository.ILoggerRepository[] repositories = log4net.LogManager.GetAllRepositories(); foreach (log4ne &hellip; <a href=\"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Chaging log output destination path with log4net<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"1375","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-3398","post","type-post","status-publish","format-standard","hentry","category-net","en-US"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Chaging log output destination path with log4net - Pistolfly<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Chaging log output destination path with log4net - Pistolfly\" \/>\n<meta property=\"og:description\" content=\"log4net.Repository.ILoggerRepository[] repositories = log4net.LogManager.GetAllRepositories(); foreach (log4ne &hellip; Continue reading Chaging log output destination path with log4net &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html\" \/>\n<meta property=\"og:site_name\" content=\"Pistolfly\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-17T04:31:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-07-31T03:07:15+00:00\" \/>\n<meta name=\"author\" content=\"Pistolfly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pistolfly\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html\"},\"author\":{\"name\":\"Pistolfly\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"headline\":\"Chaging log output destination path with log4net\",\"datePublished\":\"2012-05-17T04:31:42+00:00\",\"dateModified\":\"2017-07-31T03:07:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html\"},\"wordCount\":31,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"articleSection\":[\".NET\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html\",\"name\":\"Chaging log output destination path with log4net - Pistolfly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\"},\"datePublished\":\"2012-05-17T04:31:42+00:00\",\"dateModified\":\"2017-07-31T03:07:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2012\\\/05\\\/chaging-log-output-destination-path-with-log4net.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chaging log output destination path with log4net\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/\",\"name\":\"Pistolfly\",\"description\":\"Developer Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\",\"name\":\"Pistolfly\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"caption\":\"Pistolfly\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\"},\"description\":\"Software Engineer in Tokyo, Japan\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/author\\\/pistolfly\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Chaging log output destination path with log4net - Pistolfly","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html","og_locale":"en_US","og_type":"article","og_title":"Chaging log output destination path with log4net - Pistolfly","og_description":"log4net.Repository.ILoggerRepository[] repositories = log4net.LogManager.GetAllRepositories(); foreach (log4ne &hellip; Continue reading Chaging log output destination path with log4net &rarr;","og_url":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html","og_site_name":"Pistolfly","article_published_time":"2012-05-17T04:31:42+00:00","article_modified_time":"2017-07-31T03:07:15+00:00","author":"Pistolfly","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pistolfly"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html#article","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html"},"author":{"name":"Pistolfly","@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"headline":"Chaging log output destination path with log4net","datePublished":"2012-05-17T04:31:42+00:00","dateModified":"2017-07-31T03:07:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html"},"wordCount":31,"commentCount":0,"publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"articleSection":[".NET"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html","url":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html","name":"Chaging log output destination path with log4net - Pistolfly","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#website"},"datePublished":"2012-05-17T04:31:42+00:00","dateModified":"2017-07-31T03:07:15+00:00","breadcrumb":{"@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2012\/05\/chaging-log-output-destination-path-with-log4net.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.pistolfly.com\/weblog"},{"@type":"ListItem","position":2,"name":"Chaging log output destination path with log4net"}]},{"@type":"WebSite","@id":"https:\/\/www.pistolfly.com\/weblog\/#website","url":"https:\/\/www.pistolfly.com\/weblog\/","name":"Pistolfly","description":"Developer Blog","publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pistolfly.com\/weblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab","name":"Pistolfly","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","caption":"Pistolfly"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g"},"description":"Software Engineer in Tokyo, Japan","url":"https:\/\/www.pistolfly.com\/weblog\/author\/pistolfly"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paorzz-SO","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/3398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/comments?post=3398"}],"version-history":[{"count":4,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/3398\/revisions"}],"predecessor-version":[{"id":3794,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/3398\/revisions\/3794"}],"wp:attachment":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/media?parent=3398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/categories?post=3398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/tags?post=3398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}