What is the advantage of [insert your favorite registration library here] through System.Diagnostics.Trace?

Sorry if I missed this, but I could not immediately find a similar question in SO.

.Net comes with some built-in logging capabilities (essentially System.Diagnostics.Debug and System.Diagnostics.Trace).

Is there a good reason not to use these built-in logging tools in a typical LOB application, but instead use loglognet, NLog, Entlog or one, or insert your favorite logging library?

EDIT: note that I'm more interested in identifying the flaws of the System.Diagnostics wrt and not the functions of the various journal libraries.

+4
source share
4 answers

I prefer to use NLog or log4net because it gives me:

  • The purpose of the journal. I can choose the best for a specific purpose without changing a single logging code
  • I can record the information that I need in a particular situation, thanks to the levels of the log
  • I can format the journal entry as I like, as well as in various ways for different purposes.
  • Performance is fine, thanks for batch processing
  • I do not invent a wheel
  • I can repeat this many times.
+3
source

It may be useful to send your logs to multiple endpoints (syslog, database, event log, etc.).

+2
source

I use log4net, and the advantage is that in the configuration files you can choose what level of logging you need (critical, error, warning, information, debugging), and you get free information about email logs and sliding logs.

+1
source

For .net, I like to use http://netcommon.sourceforge.net/doc-latest/reference/html/logging.html . This is basically a cover layer above, so under it you can easily switch to journaling. This is very similar to log4net.

There is also:

http://commons.apache.org/logging/guide.html

0
source

All Articles