Most log libraries, such as log4net and Enterprise Library, choose to swallow exceptions that can be thrown during the logging process to prevent the application from stopping. Because of this, these libraries cannot be called "reliable" (according to the log4net documentation).
In my opinion, failure to register an event is a serious failure and should not be swept under the rug. Missing log messages can be used by hackers to hide their traces or at least make it much harder to find the root cause of the problem.
For me, this was one of the reasons for creating a log library called CuttingEdge.Logging . Logging providers in CuttingEdge.Logging will always throw an exception if the event cannot be logged. By setting up a "backup provider for a specific logger," users can prevent the call stack bubbles from being excluded and allow the backup provider to register the original message and the exception caused by the registrar failure. The backup providers themselves can also have a backup provider configured. This mechanism is very unlikely that exceptions will not be logged when using CuttingEdge.Logging.
source share