Common.Logging
Common.Logging is a logging facade that provides similar interface for creating loggers and perform logging operations in a unified way. It could be configured to use log4net, NLog, Enterprise Library 3.1 Logging Adapter as a back-end loggers.
The question is how Common.Logging facade influence on the final logging performance? I'll test Common.Logging over log4net for different appenders - NullAppender, FileAppender, RollingFileAppender.
Add Common.Logging to the sample application
It is very simple to integrate Common.Logging into the sample application. Just add Common.Logging and log4net packages (current version is 1.2.13) with a NuGet to the project.
Add to the project log4net.config file:
Initialize logging manager and create a logger in code:
Performance influence of the Common.Logging
Conclusions
- Common.Logging is a good logging facade with a most popular logging back-ends - log4net, NLog, Enterprise Library 3.1 Logging Adapter
- Common.Logging can be easily extended in future by creating or adapting new logging back-end
- Common.Logging performance impact is very small (in my cases about 5%)
- I decided to use Common.Logging as a front-end logger facade in my environment! All future performance improvements in logging will be made only in back-end part (log4net asyc appenders).
No comments:
Post a Comment