Log file generation is very useful in your system to put errors and exceptions in a file. This blog shows how to add a logging feature to a Windows application.
First, you need a copy the Log.Dll file to your project (Download attached file).
Then add reference to Log.Dll by right click on the project, select Add Reference and browse the DLL.
Now we use Dll in our form.
After declare namespace you can use writelog function.
You want to print any exception message in log file then use
You want to print only message in log file.