If you ever needed a simple logger and did not want to deal with the complexity of configurating Log4net or the enterprise library you might find this class useful. This is a single class, single file rolling file appender.

Usage:

To use this logger all you need to do is either add the class to your code or use the DLL as a reference. If you chose to use the dll you need to import it in your code as follows:

using InvertedSoftware.PLogger.Provider;

Then to write a log line you simply need to call:

RollingLogProvider.Instance.Log("Default Message");

Default values: by default, the logger will write a file named rolling.log and will start a new file every 1MB of data. The file will be placed in the current working directory.

I got back 321 milliseconds for 1,000,000 messages and 4.76 seconds for 1,000,000 template messages. In all fairness if you look at the code, you will notice it is using a Task to write to the log file so calling Log will return before the message was actually written to the disk, however, using this method still speeds up your system significantly. I have attached both the source code and the compiled DLL to the zip file below and would love to hear feedback from users.

Update: I have placed the code in codeplex and will be maintaining it there.