This simple, console application is written in C# and uses log4net.
Create a console application and name it LoggingFun.
Right-click on the project and choose Manage NuGet Packages. Add "log4net".
Right-click and add a text file named "log4net.config" to the project.
Right-click on log4net.config and choose properties. Make sure you copy the file to the output directory.
Let's write "Hello World!" to the log.
Running this creates a bin/Debug folder. If you click the "Show All Files" icon in the Solution Explorer, you will see
the folder along with the "loggingfun.log" file. You can view the log file by double-clicking it.
The output in the file is simply "Hello World!". We can add formatting if we need the time and level of error displayed
in the log. We do this with log4net's
Now the program writes, "2014-03-31 09:41:38,410 ERROR - Hello World!".
I hope this little example of log4net helps you, and I welcome your feedback.