Global error logging method

ashok.k

Member
Joined
Jun 26, 2009
Messages
13
Programming Experience
Beginner
Hi

I am working on a .NET 4.0 console application. I want to capture the error that occurs while running the application and write to a Log file. (Log_Datetime.txt)

Log file has to be created for every day. How to check if log file for that day has already been created? If log file is not created, a new file has to be created and the details have to be written. If log is already created, the error message has to be appended to the existing log file.

Also, How to get the method name at run time where the error occured?

Thanks
Ashok
 
Back
Top