Improved stack-trace loggging