I have a C#/WPF application and want to add a logging feature.

  • This would be used to record errors/exceptions, maybe log user actions, or anything that might help identify a problem reported by users.

  • It would need to be able to write the log details to SQL and locally (the last is critical when the problem is an SQL exception... )

  • Ideally, it would have basic support for reporting exceptions so I don't have to break those out into various values to be posted.

  • If it supports multiple languages (say Python) that would be a plus, but is not a requirement.

In the past, I have used Serilog and can use that again (it meets all of the above). But wanted to check to see if there were other options that I should evaluate before committing to it.

Any recommendations are greatly appreciated.

2 Answers 2


Log4Net is one of the most widely used and stable logging frameworks and is what we used as a standard for logging to multiple targets depending on the level of logging (ie levels WARN and DEBUG would go to separate files while FATAL errors would be sent out in an email)

Here is a overview of Log4Net and how to use it: https://www.c-sharpcorner.com/article/log4net-and-net-core/

Here is very helpful list of the major different Logging Frameworks based on the language used: https://www.loggly.com/ultimate-guide/python-logging-libraries-frameworks/


In the past, I have used Serilog and can use that again

I would argue that this is a sensible choice. AFAIK it is the most modern among the most popular and stable logging frameworks and is built around the idea of structured logging as a first-class citizen.

Or you can stick to the built-in one. It does not have a build in database provider, but it should not be that hard to implement one if needed.

  • To make it a better answer, please put the essential information about it in your answer. Commented Jan 30, 2023 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.