Skip to content

What is meant of following line Please explain me...?

Krishna Maurya

Krishna Maurya

Asked Aug 29, 2016, 8:39 PM EDTSolved
Share
LinkedInX
What is meant of
 
private static readonly ILog log = LogManager.GetLogger(typeof(AccountController));

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Surya Kant
    ✓ Accepted answer0

    LogManager is a class has static methods that are used by a client to request a logger instance. The GetLogger method is used to retrieve a logger.

    The GetLogger method return the object of type ILog which contains methods for logging at different levels and also has properties for determining if those logging levels are enabled in the current configuration.

    Hence you capturing data using ILog variable and typeof(AccountControoler) means you will get the log of AccountController.
    typeof() :- Always returns the full Namespace with the Name of that type.
    Hope this will help you.
    Thanks.
    0