Catching exceptions raised on logging to avoid exceptions being caused when run on a travis worked.