« Return to Thread: NLog and Commons.Logging question

NLog and Commons.Logging question

by Adrian Rodriguez-2 :: Rate this Message:

Reply to Author | View in Thread

Hi.  I have a question concerning the use of NLog with Commons.Logging
from netcommon.sf.net.  We're trying to evaluate a solution where we
don't have to stick to a particular logging implementation.  We found
netcommon, but we're having some trouble with it and I haven't received
any responses from either list so I figured I would ask here.  I have 2
questions:

Question 1)
Here is the question I asked to netcommon and springnet-developer:

We started using common logging with nlog.  Unfortunately, the nlog
${callsite} always renders the method name in Common.Logging.  Has
anyone here been through this before?  I want the ${callsite} to render
the method I called Common.Logging from.  If I don't have this, I don't
know where the message came from.  Would the right way be to use
${stacktrace} instead of ${callsite}?

If anyone could provide some help in this area, I'd be very grateful.

Question 2)
It was suggested that we go through a single shared logger instead of
doing LogManager.GetCurrentClassLogger().
If we had some static logger like:

namespace MyCompany
{
    public static class Logging
    {
        private static Logger logger = LogManager.GetLogger("My Company
Logger");
        public static Logger
        {
            get { return logger; }
        }
    }
}

And used it like Logging.Logger.Debug(), Trace(), etc...will this cause
any performance problems since we are only using one logger instead of
creating one in every class?

Any help on this would be great.  If anyone has any experience going
through this at your company (not being tied to a particular logging
implementation), I'd really appreciate your input.

Thanks.

<adrian />


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nlog-list mailing list
Nlog-list@...
https://lists.sourceforge.net/lists/listinfo/nlog-list

 « Return to Thread: NLog and Commons.Logging question

LightInTheBox - Buy quality products at wholesale price!