Capture Exceptions in log file