Sponsors

News

Jobping Laurent Kempé MVP JetBrains Academy Member Certified ScrumMaster

Contact

My status

View Laurent Kempé's profile on LinkedIn
XING
twitter
facebook


Xbox 360



Map

Locations of visitors to this page

.NET Dudes

Family

French .NET Dudes

Friends

Jobping

Links

Tech Head Brothers

Log4net nice idea :-)

If you are using log4net like me then I am sure you will like this idea. I combined it with ReSharper.

A log4net tip


private static readonly ILog log = LogManager.GetLogger(typeof(MyClass));

I'm writing more than once some days. Nothing difficult here, but I can save a reference to MyClass by using reflection (tip provided by Nicko Cadell) :

#region Logging Definition
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion

Comfortable when combined with quickcode or added to a "create new class" wizard.

Comments

dru said:

I was thinking of doing something like this. Maybe by putting in a base class that gets init'ed in the Base constructor.

Private Sub New()
  log = LogManager.GetLogger(typeof(me)
End Sub
# November 4, 2004 10:17 PM