This project is read-only.

Log4net vs SLAB: My 2 cents

Topics: General, Using
Dec 23, 2014 at 3:33 PM
Hello,
We've been using log4net for long time, and we've evaluated SLAB if we can make use of it. Although Many things of SLAB are superior compared to other solutions we decided to stick with log4net. I will list my reasons so that it might contribute future road map of SLAB.

Log4net:
Pros:
  • Very flexible: Tons of appenders , hierarchical loggers
  • xml configuration for in proc logging: We don't want to recompile our code when logging need changes.
  • Mature
Cons:
  • Slow and synchronous
  • Greater chance to lose logs if your app crashes
  • No portable library support
  • Only works in proc mode:
  • Relatively old and not getting updates
SLAB:
  • Pros: ETW Based, and very fast
  • In proc as well as out of proc mode
  • Can be machine wide
  • Keyword based flexible filtering
  • Less chance to lose logs
  • Supports Portable Libs
  • Live capturing with external tools lile Perfview
  • Semantic logging with structured data.
  • No need for 3rd party dependencies nor xml required for your app
While the pros are far superior the cons are far worse that makes SLAB unusable for our business.

Cons:
  • No hierarchical loggers: probably a limitation of ETW Event source. But Assume you have 10 dlls each having 3 EventSources no one will remember all these names. And without these names you cannot log them
  • In proc mode doesn't use XML : I cannot understand the motivation behind this. While your app is running some times you want to switch to verbose logging mode
  • Out of proc mode uses a single xml, so new when new apps deployed to the server, somebody has to configure that single xml file.
  • Process based filters are rather weak: First they only work with windows 8.1 and windows server 2012 R2 and when you have same process name for different apps you have a problem like IIS processes or Microsoft Addin Framework, all these have same process name and you cannot change it.
  • Low number of appenders.
To sum up we ideally want a separate log file on the application root folder and we want to configure it via a config file. This is the most standard scenario with application logging and is not achievable via SLAB

Thanks
Jan 22, 2015 at 1:49 AM
Thanks! We'll be working on our roadmap for a future release of SLAB soon. This is very helpful.