Added logging to exception handling blocks

Added a log call in each catch block to print the contents of the
exception