Thanks Andrew and George for your feedback. I expected that log4net works
with .NET 4.5 - except for some cases that are covered in the migration
article from microsoft. Please post a sample project that does not work and
then maybe we are able to trace what's going wrong.
2013/4/9 George Chung
Some code:
using log4net;
using log4net.Config;
public partial class Login
{
private static readonly log4net.ILog log =
log4net.LogManager.GetLogger(typeof(Login));
UserServices usrsrv = new UserServices();
}
private void Form1_Load(object sender, EventArgs e)
That command is not working on the new 1.2.1.1...
I didn't know I have to run such a command..
Can you give an example for my project and my version of log4net?
with all respect, but I read the manual and the configuration settings
BasicConfigurator.Configure(); it gives me and error saying ...It's a method
but is used like a type
El Tigre™ ©
From: Dominik Psenner dpsen...@gmail.com
To: 'Log4NET User'
Did you place that statement outside of any method or constructor?
_
From: El Tigre [mailto:el_tigre...@yahoo.com]
Sent: Wednesday, April 10, 2013 9:34 AM
To: Log4NET User
Subject: Re: Log4net NOT working on .net 4.5
with all respect, but I read the manual and the configuration
GOT it... had to put the initialize method din the constructor without
parameters:
public Form1()
{
InitializeComponent();
XmlConfigurator.Configure();
}
NOw it works! thank you for help!
I'm glad you finally worked it out and I hope you learned something. In the
future you should consult the manuals and check if
you're doing things how it's written down in the manuals. Posting something
like all is setup correctly (I have used log4net in the
past) without being sure can cause
Generally it is good idea to configure logging system as early as possible to
avoid such problem. Good place is Main() method of the class which starts the
whole application.
Radovan
Od: Dominik Psenner [mailto:dpsen...@gmail.com]
Odesláno: 10. dubna 2013 10:29