Log4net: simple way to use in your Asp.net application(blog.emanuelebartolesi.com)

submitted by kasukenkasuken(275) 4 years, 5 months ago

How to use Log4net in your asp.net application.

2 comments |category: |Views: 86

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by offwhiteoffwhite(975) 4 years, 4 months ago 0

His comment system is broken (I tried IE and FF) so I will ask my question here...

Why this...

LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

and not this...

LogManager.GetLogger(GetType());

???

I assume you would get the same type either way. No?

Reply

posted by davehoguedavehogue(160) 4 years, 4 months ago 0

I think the difference would be when that line of code is in a base class and the object is an instance of a child class. In that case GetType() would return the child class type and DeclaringType would return the base class type.

Reply

information Login or create an account to comment on this story