Switch to slf4j, improve logging and error handling.