tag:blogger.com,1999:blog-156063398213747348.post2896437744198931450..comments2023-05-14T03:27:45.885-07:00Comments on Me And My Code: Logging using Log4Net in WPFHiren Khirsariahttp://www.blogger.com/profile/15724930734720480641noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-156063398213747348.post-36171948279600172732017-08-23T23:25:36.132-07:002017-08-23T23:25:36.132-07:00Working fine, Thank you.Working fine, Thank you.Anonymoushttps://www.blogger.com/profile/09768264152173940854noreply@blogger.comtag:blogger.com,1999:blog-156063398213747348.post-76710764855890448112017-04-14T04:41:53.306-07:002017-04-14T04:41:53.306-07:00working 100% . Thank you!working 100% . Thank you!Anonymoushttps://www.blogger.com/profile/13850151188061173825noreply@blogger.comtag:blogger.com,1999:blog-156063398213747348.post-80287317548982075472014-11-23T23:53:37.456-08:002014-11-23T23:53:37.456-08:00Must uncomment the commented lines in the followin...Must uncomment the commented lines in the following...<br /><br />static Logger()<br /> {<br /> //var log4NetConfigDirectory = <br /> //AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;<br /> //var log4NetConfigFilePath = Path.Combine(log4NetConfigDirectory, "log4net.config");<br /> //log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(log4NetConfigFilePath));<br /> log = LogManager.GetLogger(typeof(Logger));<br /> log4net.GlobalContext.Properties["host"] = Environment.MachineName;<br /> }<br /><br />as...<br /><br />var log4NetConfigDirectory = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;<br />var log4NetConfigFilePath = Path.Combine(log4NetConfigDirectory, "log4net.config");<br /> log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(log4NetConfigFilePath));Anonymoushttps://www.blogger.com/profile/01385851524930126492noreply@blogger.comtag:blogger.com,1999:blog-156063398213747348.post-60371264091905890132014-05-09T05:21:33.762-07:002014-05-09T05:21:33.762-07:00This is not working for me, maybe some code missin...This is not working for me, maybe some code missing in app.xaml.cs<br /><br />private static readonly ILog Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);<br /><br />protected override void OnStartup(StartupEventArgs e)<br /> {<br /> log4net.Config.XmlConfigurator.Configure();<br /> //Log.Info("Hello World");<br /> base.OnStartup(e);<br /> }<br /><br />after placing these two lines it worked for me I found them at https://gist.github.com/bobbychopra/2897163<br /><br />Thanks,<br />Abdul Mateen.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-156063398213747348.post-31719296212967015722013-04-23T13:02:55.531-07:002013-04-23T13:02:55.531-07:00Sorry, but it is not working for me if I do not in...Sorry, but it is not working for me if I do not include configsection in app.configAnonymoushttps://www.blogger.com/profile/03020055459475706045noreply@blogger.comtag:blogger.com,1999:blog-156063398213747348.post-5973465706627715642012-09-26T06:31:47.076-07:002012-09-26T06:31:47.076-07:00Very helpful in getting this setup quickly in WPF....Very helpful in getting this setup quickly in WPF. Thank you!Chadhttps://www.blogger.com/profile/16650594886230239122noreply@blogger.com