I would be doing you a disservice to give you “code for logging”, but I can point you towards the File
class, which contains useful methods for writing text to a file. Since you specify no other needs, I suspect it will suffice.
File
http://msdn.microsoft.com/en-us/library/system.io.file.aspx
solved How to create a log file in c# for windows application? [closed]