Fix logging stacktrace