Print stacktrace to logfile