Add support for custom logger.

Should allow log/syslog use.