Step 1- Install log4net from nuget package manager.
Step 2- Add following code in your config file.
Step 3- Create instance of log4net to write logs.
Step 4- Now start write logs in your code.
Check your directory bin/Debug/ new folder logs is created where the log.txt file is created.