I am relatively new to C #, so please bear with me. I am looking for a logging solution for my project (desktop application for small business). I know this has been asked a million times, but I have additional requirements and questions.
Is there a logging tool for .NET that is (all of the following):
- reliable (logging everything that was sent to the log, even the most recent exception before the failure, log4net does not guarantee this)
-fast (not blocking the caller → asynchronous)
- thread - safe (can be called from several streams at the same time and written to one file)
- encrypts the log files (or allows you to fully configure logging - records only what it receives, has no additional information)
-is free
Ok, this is my list of requirements. Do you know any fees that fit? I read about log4net, but it seems old (uses .NET 2.0 and basically reinvents the wheel), nlog sounds promising as it is asynchronous, but again I think it cannot encrypt. Also I do not know if they are completely safe for everyone.
Should I just write my own registrar? I was thinking of creating a log, a list (or queue) of logs and using a lock added to the list of corresponding logs, the logging thread will convert (possibly a string or some parts to a string) log objects, encrypt them and save them to a file as soon as possible .
What do you think I should do? Thanks for your ideas and answers.
source
share