SlideShare a Scribd company logo
17/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Benchmarking
5 Popular .NET
Logging Libraries
Presented by:
27/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Introduction
Several logging frameworks promise .NET coders a “five-minute setup and start
logging” solution for their projects. We decided to test these frameworks to
identify speed and convenience between them. We added convenience into the
equation because most .NET coders know that they can write events to the
Windows Event Viewer without implementing any extra libraries. However,
writing to the Event Viewer doesn’t always work for some applications – for
instance, you might want to write events to a log file to share with other
departments or run analytics against a group of logs.
loggly.com/net-logging-benchmark/
37/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
.NET logging frameworks tested
Log4net ELMAH Nlog
Microsoft
Enterprise
Library
NSpring
loggly.com/net-logging-benchmark/
47/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Testing process
• Wrote error events to files for each framework test
• ELMAH automatically writes to files unless you specifically tell it to log to SQL
• Used default configurations for each framework
• Performance may be different with other settings
Log4net ELMAH Nlog
Microsoft
Enterprise
Library
NSpring
loggly.com/net-logging-benchmark/
57/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our test results
Log4net
46.83
Nlog EntLib ElmahNspring
9.33
12.07
18.17
89.64
Seconds/100000 Log Events
loggly.com/net-logging-benchmark/
67/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our test results
• NLog was the fastest and also very convenient
• Stood by its claim that you could start logging
events in minutes
• One line in our code to instantiate the main logger class
• The other to log the events
Easy to set up, took about 9 seconds
to complete 100,000 iterations1st PLACE NLog
Log4net
46.83
NLog EntLib ElmahNspring
9.33 12.07
18.17
89.64
Seconds/100000 Log Events
loggly.com/net-logging-benchmark/
77/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our test results
• Log4net was just as convenient, but it lost in
terms of performance
• Debug logging was actually faster than
standard error events
Just as convenient as Nlog but slower
performance.2nd PLACE Log4net
Log4net
46.83
NLog EntLib ElmahNspring
9.33 12.07
18.17
89.64
Seconds/100000 Log Events
loggly.com/net-logging-benchmark/
87/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our test results
• You must open and close NSpring logger
events, which you don’t need to do with the
others
• A few more lines of code in a simple
application aren’t too much of a hassle, but
opening and closing logger variables can be
tedious for enterprise applications
Easy to set up, but required much more code
to work with it3rd PLACE NSpring
Log4net
46.83
NLog EntLib ElmahNspring
9.33 12.07
18.17
89.64
Seconds/100000 Log Events
loggly.com/net-logging-benchmark/
97/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our test results
• ELMAH is a web logger, so it functions a bit
differently than the others
• It writes to an XML file by default, which could
also explain some of its lag
Originally our favorite until we tested NLog4th PLACE ELMAH
Log4net
46.83
NLog EntLib ElmahNspring
9.33 12.07
18.17
89.64
Seconds/100000 Log Events
loggly.com/net-logging-benchmark/
107/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our test results
• Our least favorite tested in a console
application
• Version 5.0: the coder could make a static call
to log functions
• Version 6.0: we encountered numerous
obstacles to get EntLib to work
Setup time for EntLib downgrades this library
even though it was the second fastest5th PLACE EntLib
Log4net
46.83
NLog EntLib ElmahNspring
9.33 12.07
18.17
89.64
Seconds/100000 Log Events
loggly.com/net-logging-benchmark/
117/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Conclusion
• Nlog was the clear performance winner and benefits from good support
from the community with integrations for log management solutions
like Loggly
• Nspring also demonstrated fast performance
• Log4net was one of the easiest to set up but had slower performance
• All of these frameworks are available in NuGet, so you can try them out
for yourself
loggly.com/net-logging-benchmark/
127/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
About the author
Jennifer Marsh is a C# developer who has written for
popular tech sites such as Adobe, IBM, Backspace,
and Udemy. Her background is C# development, and
she has experience with network administration and
DevOps. She enjoys coding in her spare time on her
never-finished website, pinkhatcode.com, and helping
people understand the intricacies of Windows
development and its server environment.
loggly.com/net-logging-benchmark/
137/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Appendix
147/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our testing environment
Additional details on test structure
• We did not make many configurations to the frameworks themselves. We
chose libraries available in NuGet, so developers didn’t need to download
specific libraries and integrate DLLs and third-party solutions into the main
project
• The project consisted of only the necessary libraries for .NET to compile and
execute the code. The code contained one loop that iterated through
100,000 write debug events for each framework. A separate method handled
the prime number thread
• We ran three tests on each framework and used the average results
loggly.com/net-logging-benchmark/
157/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
Our testing environment
Server hardware
We wanted to give these benchmark tests an
environment that’s representative of the real
world, so we tested them on a server hosting
three web applications. The environment also
hosts SQL Server and MySQL for the three
applications. To simulate CPU load, we still set
up a separate threaded process that generated
prime numbers while the tests were run and
timed. The work environment accounts for
higher numbers than other benchmarks, but we
find it is more true-to-life than simple prime
number generation.
Our production server is a Windows 2008
server with 8GB of RAM and an i5 Intel
processor with four cores, one core for each
thread. The applications were created using
Visual Studio 2012. Log4net, NLog, Microsoft
Enterprise Library, and NSpring were all
benchmarked on console applications. ELMAH
is a web logger, so this application was run
against a web application in .NET 4.5. We also
used C# as the primary language framework.
loggly.com/net-logging-benchmark/
167/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG:
So you implemented logging. Now what?
Loggly is the world’s most popular cloud-based, enterprise-class log management service, serving more
than 10,000 customers including one-third of the Fortune 500. The Loggly service integrates into the
engineering processes of teams employing continuous deployment and DevOps practices to reduce MTTR,
improve service quality, accelerate innovation, and make better use of valuable development resources.
Centralize all of your log data and see what matters fast.
Try Loggly for free!
http://www.loggly.com/trial
loggly.com/net-logging-benchmark/

More Related Content

PDF
SpringOne 2016 in a nutshell
PPTX
How to Achieve more through Collaboration
PDF
Building your production tech stack for docker container platform
PDF
Windows container security
PPTX
Nanog75, Network Device Property as Code
PPTX
Infrastructure as Code for Network
PDF
Building Cloud Virtual Topologies with Ravello and Ansible
PDF
Demystifying container connectivity with kubernetes in docker
SpringOne 2016 in a nutshell
How to Achieve more through Collaboration
Building your production tech stack for docker container platform
Windows container security
Nanog75, Network Device Property as Code
Infrastructure as Code for Network
Building Cloud Virtual Topologies with Ravello and Ansible
Demystifying container connectivity with kubernetes in docker

What's hot (20)

PDF
A Story of Cultural Change: PayPal's 2 Year Journey to 150,000 Containers wit...
PDF
Troubleshooting tips from docker support engineers
PDF
The 12 Factor App
PPTX
Perforce Helix Never Dies: DevOps at Bandai Namco Studios
PDF
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
PDF
Transform Digital Business with DevOps
PDF
Jenkins Reviewbot
PDF
Shipping and Shifting ~100 Apps with Docker EE
PDF
Rails Applications with Docker
PDF
12 factor apps
PPTX
Hot to build continuously processing for 24/7 real-time data streaming platform?
PDF
Jenkins in the real world - DevOpsCon 2017
PDF
Ansiblefest 2018 Network automation journey at roblox
PDF
Prepare to defend thyself with Blue/Green
PDF
Brujug Jenkins pipeline scalability
PDF
JUC Europe 2015: Scaling Your Jenkins Master with Docker
PDF
How To Be a Java Automated Testing Superstar
PPTX
12 Factor App Methodology
PDF
Banog meetup August 30th, network device property as code
PPTX
SkyBase - a Devops Platform for Hybrid Cloud
A Story of Cultural Change: PayPal's 2 Year Journey to 150,000 Containers wit...
Troubleshooting tips from docker support engineers
The 12 Factor App
Perforce Helix Never Dies: DevOps at Bandai Namco Studios
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
Transform Digital Business with DevOps
Jenkins Reviewbot
Shipping and Shifting ~100 Apps with Docker EE
Rails Applications with Docker
12 factor apps
Hot to build continuously processing for 24/7 real-time data streaming platform?
Jenkins in the real world - DevOpsCon 2017
Ansiblefest 2018 Network automation journey at roblox
Prepare to defend thyself with Blue/Green
Brujug Jenkins pipeline scalability
JUC Europe 2015: Scaling Your Jenkins Master with Docker
How To Be a Java Automated Testing Superstar
12 Factor App Methodology
Banog meetup August 30th, network device property as code
SkyBase - a Devops Platform for Hybrid Cloud
Ad

More from SolarWinds Loggly (13)

PDF
Loggly - Tools and Techniques For Logging Microservices
PDF
Loggly - IT Operations in a Serverless World (Infographic)
PDF
Loggly - Case Study - Loggly and Docker Deliver Powerful Monitoring for XAPPm...
PDF
Loggly - Case Study - Stanley Black & Decker Transforms Work with Support fro...
PDF
Loggly - Case Study - Loggly and Kubernetes Give Molecule Easy Access to the ...
PDF
Loggly - Case Study - Datami Keeps Developer Productivity High with Loggly
PDF
Loggly - Case Study - BEMOBI - Bemobi Monitors the Experience of 500 Million ...
PDF
Loggly - How to Scale Your Architecture and DevOps Practices for Big Data App...
PDF
Loggly - Benchmarking 5 Node.js Logging Libraries
PDF
Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...
PDF
6 Critical SaaS Engineering Mistakes to Avoid
PDF
Rumble Entertainment GDC 2014: Maximizing Revenue Through Logging
PDF
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
Loggly - Tools and Techniques For Logging Microservices
Loggly - IT Operations in a Serverless World (Infographic)
Loggly - Case Study - Loggly and Docker Deliver Powerful Monitoring for XAPPm...
Loggly - Case Study - Stanley Black & Decker Transforms Work with Support fro...
Loggly - Case Study - Loggly and Kubernetes Give Molecule Easy Access to the ...
Loggly - Case Study - Datami Keeps Developer Productivity High with Loggly
Loggly - Case Study - BEMOBI - Bemobi Monitors the Experience of 500 Million ...
Loggly - How to Scale Your Architecture and DevOps Practices for Big Data App...
Loggly - Benchmarking 5 Node.js Logging Libraries
Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...
6 Critical SaaS Engineering Mistakes to Avoid
Rumble Entertainment GDC 2014: Maximizing Revenue Through Logging
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
Ad

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Building Integrated photovoltaic BIPV_UPV.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
Modernizing your data center with Dell and AMD
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks

Loggly - 5 Popular .NET Logging Libraries

  • 1. 17/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Benchmarking 5 Popular .NET Logging Libraries Presented by:
  • 2. 27/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Introduction Several logging frameworks promise .NET coders a “five-minute setup and start logging” solution for their projects. We decided to test these frameworks to identify speed and convenience between them. We added convenience into the equation because most .NET coders know that they can write events to the Windows Event Viewer without implementing any extra libraries. However, writing to the Event Viewer doesn’t always work for some applications – for instance, you might want to write events to a log file to share with other departments or run analytics against a group of logs. loggly.com/net-logging-benchmark/
  • 3. 37/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: .NET logging frameworks tested Log4net ELMAH Nlog Microsoft Enterprise Library NSpring loggly.com/net-logging-benchmark/
  • 4. 47/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Testing process • Wrote error events to files for each framework test • ELMAH automatically writes to files unless you specifically tell it to log to SQL • Used default configurations for each framework • Performance may be different with other settings Log4net ELMAH Nlog Microsoft Enterprise Library NSpring loggly.com/net-logging-benchmark/
  • 5. 57/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our test results Log4net 46.83 Nlog EntLib ElmahNspring 9.33 12.07 18.17 89.64 Seconds/100000 Log Events loggly.com/net-logging-benchmark/
  • 6. 67/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our test results • NLog was the fastest and also very convenient • Stood by its claim that you could start logging events in minutes • One line in our code to instantiate the main logger class • The other to log the events Easy to set up, took about 9 seconds to complete 100,000 iterations1st PLACE NLog Log4net 46.83 NLog EntLib ElmahNspring 9.33 12.07 18.17 89.64 Seconds/100000 Log Events loggly.com/net-logging-benchmark/
  • 7. 77/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our test results • Log4net was just as convenient, but it lost in terms of performance • Debug logging was actually faster than standard error events Just as convenient as Nlog but slower performance.2nd PLACE Log4net Log4net 46.83 NLog EntLib ElmahNspring 9.33 12.07 18.17 89.64 Seconds/100000 Log Events loggly.com/net-logging-benchmark/
  • 8. 87/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our test results • You must open and close NSpring logger events, which you don’t need to do with the others • A few more lines of code in a simple application aren’t too much of a hassle, but opening and closing logger variables can be tedious for enterprise applications Easy to set up, but required much more code to work with it3rd PLACE NSpring Log4net 46.83 NLog EntLib ElmahNspring 9.33 12.07 18.17 89.64 Seconds/100000 Log Events loggly.com/net-logging-benchmark/
  • 9. 97/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our test results • ELMAH is a web logger, so it functions a bit differently than the others • It writes to an XML file by default, which could also explain some of its lag Originally our favorite until we tested NLog4th PLACE ELMAH Log4net 46.83 NLog EntLib ElmahNspring 9.33 12.07 18.17 89.64 Seconds/100000 Log Events loggly.com/net-logging-benchmark/
  • 10. 107/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our test results • Our least favorite tested in a console application • Version 5.0: the coder could make a static call to log functions • Version 6.0: we encountered numerous obstacles to get EntLib to work Setup time for EntLib downgrades this library even though it was the second fastest5th PLACE EntLib Log4net 46.83 NLog EntLib ElmahNspring 9.33 12.07 18.17 89.64 Seconds/100000 Log Events loggly.com/net-logging-benchmark/
  • 11. 117/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Conclusion • Nlog was the clear performance winner and benefits from good support from the community with integrations for log management solutions like Loggly • Nspring also demonstrated fast performance • Log4net was one of the easiest to set up but had slower performance • All of these frameworks are available in NuGet, so you can try them out for yourself loggly.com/net-logging-benchmark/
  • 12. 127/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: About the author Jennifer Marsh is a C# developer who has written for popular tech sites such as Adobe, IBM, Backspace, and Udemy. Her background is C# development, and she has experience with network administration and DevOps. She enjoys coding in her spare time on her never-finished website, pinkhatcode.com, and helping people understand the intricacies of Windows development and its server environment. loggly.com/net-logging-benchmark/
  • 13. 137/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Appendix
  • 14. 147/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our testing environment Additional details on test structure • We did not make many configurations to the frameworks themselves. We chose libraries available in NuGet, so developers didn’t need to download specific libraries and integrate DLLs and third-party solutions into the main project • The project consisted of only the necessary libraries for .NET to compile and execute the code. The code contained one loop that iterated through 100,000 write debug events for each framework. A separate method handled the prime number thread • We ran three tests on each framework and used the average results loggly.com/net-logging-benchmark/
  • 15. 157/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: Our testing environment Server hardware We wanted to give these benchmark tests an environment that’s representative of the real world, so we tested them on a server hosting three web applications. The environment also hosts SQL Server and MySQL for the three applications. To simulate CPU load, we still set up a separate threaded process that generated prime numbers while the tests were run and timed. The work environment accounts for higher numbers than other benchmarks, but we find it is more true-to-life than simple prime number generation. Our production server is a Windows 2008 server with 8GB of RAM and an i5 Intel processor with four cores, one core for each thread. The applications were created using Visual Studio 2012. Log4net, NLog, Microsoft Enterprise Library, and NSpring were all benchmarked on console applications. ELMAH is a web logger, so this application was run against a web application in .NET 4.5. We also used C# as the primary language framework. loggly.com/net-logging-benchmark/
  • 16. 167/25/17© 2017 Loggly Inc. Confidential and ProprietaryMORE DETAILS ON OUR BLOG: So you implemented logging. Now what? Loggly is the world’s most popular cloud-based, enterprise-class log management service, serving more than 10,000 customers including one-third of the Fortune 500. The Loggly service integrates into the engineering processes of teams employing continuous deployment and DevOps practices to reduce MTTR, improve service quality, accelerate innovation, and make better use of valuable development resources. Centralize all of your log data and see what matters fast. Try Loggly for free! http://www.loggly.com/trial loggly.com/net-logging-benchmark/