Create a Logger method and pass the exception data to the Logger.
Something like this should do
public static class Logger
{
string logFilePath ;
private SetLogFilePath();
public LogMessage(string Message);
}
Call the log method in all catch blocks.if you looking for something that catches all the applcation errors then this thread will help you.
http://stackoverflow.com/questions/337702/c-sharp-how-to-implement-one-catchem-all-exception-handler-with-resume[
Catch all errors in the application]
But my suggestion would be to use individual exception handlers rather than doing all once.As in windows if application level exception is caught and handled application continues to run but will not respond to any of the user actions like button click events and other events will not work until the application is restarted.