Fix logging to work with stack traces

closes #210