Used log_exception for exception logging