Writing error messages to the logger rather than stdout

Fixes #68