TracerX Vs. Log4Net
Similarities
- TracerX uses a hierarchy of loggers just like Log4Net. The parent-child relationships are determined the same way (by the dotted substrings of the logger names). For example, "A.B" is the parent of "A.B.Anything".
- As with Log4Net, TracerX has a method called GetLogger() that takes either a string or a type and returns the corresponding logger object, creating it if it doesn't already exist.
- TracerX provides the same trace levels as Log4Net, plus one more (Verbose).
- A logger inherits its parent's trace level, all the way up to the root logger, unless explicitly overridden.
- The signatures of the Log4Net logging methods (e.g. Log.Info(), Log.Debug(), etc.) are duplicated in TracerX.
- TracerX can be configured via an XML file, the application config file, an XmlElement object, or programatically.
- Output can be directed to any combination of a file, the console, the event log, or System.Trace.WriteLine().
- The RendererMap collection, IObjectRenderer interface, and DefaultRenderer object work the same in TracerX as in Log4Net.
Differences
- TracerX does not have a generic framework for adding multiple or custom appenders. It will not log user messages to a database table or email.
- TracerX does not support remote logging.
- TracerX does not have type converters, data formatters (other than IObjectRenderer), plugins, or repository hierarchies. It is relatively simple in implementation.
- TracerX has one developer. Log4Net has about 15.
Advantages of TracerX
- The logs are much easier to read in the TracerX viewer than in a text editor.
- The TracerX viewer allows you to decide what threads, loggers, and trace levels you are interested in after the log is generated (as well as before).
- TracerX's implementation of circular logging is better than Log4Net’s RollingFileAppender because TracerX does it all within a single file. In addition, you can designate a portion of the initial logging (containing output from initialization/startup) to be preserved even after the log wraps.
- I think TracerX will perform better than Log4Net and I’m sure the files will be significantly smaller as well, though I don’t have hard numbers on that.
- TracerX generates one output file per execution of the host application and displays it in chronological order. Log4Net's RollingFileAppender can cause the output from a given execution to begin in the middle of one file and end in another.