add stacktrace and code to error log of exceptions