MongoDB log failing backups

Hi, is it possible with Java Script to capture the errors of MongoDB backup failer and send this message to Windows event logs?

Best regards