I posted this same question on the DNN Software forums and got a quick answer. To paraphrase and expand on that answer:
- The depreciated class had performance issues because the logging was done using static methods. The new style uses non-static methods so each page or class can create it's own instance of the logger. This prevents the program from waiting for the shared instance when a simultaneous log request occurs.
- ILog and DNNLogger both use the log4net configuration.
- Using ILog with LoggerSource gets you closer to the roots so it's better to use than DNNLogger but there isn't much difference.
The best way to get an object for logging is:
ILog logger = LoggerSource.Instance.GetLogger(typeof(MyClass));
Passing the class name helps contextualize the error information while reading the log file. When the class is used the log file will contain the namespace and class along with the error information.
To use the LoggerSource and ILog class the following using statement is needed:
using DotNetNuke.Instrumentation;
Hopefully this info helps anyone who is wondering about the logging changes in DNN 7.
Happy Coding!