This simple example uses log4net version 2.0.3 to write to a `MemoryAppender` which is the read to produce a string at the end of all the log messages.
We first download and install log4net version 2.0.3 using NuGet Package Manager Console:
Configuring Log4net via config file
We place the following configuration in our app/web.config file. It declares an appender called `MemoryAppender` which we will access through the C# code later. It also adds a config section under `configSections` so that log4net is configured.
Invoking Log4net's XML Configurator
Follow this post to invoke log4net's XML Configurator.
Converting Logs to a String
To get a string representation of all the logged statements, we use the following code. Note that the `result` variable will be set to the log data.