Most of us want our logs to be written to a file externally.
Whether they are application logs,console logs.
In our case have used to grab the logs for the WebDriver C# bindings using the log4net.dll's
Below are step by step instructions as to go about using log4net :
1. Add a config section in the app.config file under configuration
2. Add a appSettings section where you define a key value pair
Which would facilitate ConfigurationManager to get the value
3. I have created a config file other than that of the app.config & named it as log4net.config - below is the configuration
Have used RollingFileAppender and specified a location where these logs are to be written.
RollingFileAppender - This is just like LogFileAppender with an exception doesn't create a new file
Until it has reached the MaximumFilesize that we have configured initially
4. The below code snippet shows how we need to initialize the logger
private static readonly ILog log = LogManager.GetLogger(typeof(
5. Now accessing the key value pair from the app.config file