rerouting error messages to log