Add log entries and global exception handling