I am implementing registration on my DNN 7+ website. I would like to have a custom logging level, e.g. with log4net.
I tried to follow the log4net integration instructions found on the DNN website, http://www.dnnsoftware.com/community-blog/cid/141723/Using-log4net-with-DotNetNuke . After adding the link and line of code to use the log:
DnnLog.Info("My Logging Worked!");
A warning is reported in the code that states:
'DotNetNuke.Instrumentation.DnnLog' deprecated: '' Depreciated at 7.0.1 due to poor performance, use LoggerSource.Instance "''
I find it difficult to find information on the right way to do something. It seems that "DnnLog" has been replaced by a similar class for interacting with log4net called "DnnLogger". One difference from using this class (and the "LoggerSource" class) is that logging is no longer performed using static methods.
The GetLogger () function used to retrieve the log instance accepts some parameters, and I have not yet been able to find the documentation describing the corresponding use. The DNN source has many examples. From these examples, it can be seen that the corresponding use is for delivering the current class. Inside the file "MyClass.cs", which declares the class "MyClass", it looks like this:
ILog logger = LoggerSource.Instance.GetLogger(typeof(MyClass));
or
DnnLogger logger = DnnLogger.GetLogger("MyClass");
Which logger is returned by the first line of code using typeof ()? By this I mean, will this logger use the log4net settings configured for the site? If it does not use log4net parameters, where are the log files stored and where are the configuration parameters configured? The nerd in me wants to know exactly what happens to the typeof () class parameter, why is it used?
If the first example doesn't connect to log4net (or something that allows a customizable easy-to-use logging level), is the second option the way to go? If so, which line should go? "MyClass" was my hunch, but I couldn't confirm.
If I am fully tracking here and should approach this from a different direction, feel free to respond to offers.
Thanks everyone!