added support for logging of failed jobs