Is it possible to get variable values included in a stack trace? I have just started using bugsense which emails the stacktrace to me and I wonder if there is some way in my code to put the variable values into the stacktrace output
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not by default, you have to do it by yourself:
The stack trace will only tell you about the involved line of code (where the
Exceptionis thrown) and the execution stack.But nothing prevents you from catching the
Exceptionand to include some debug information in the message:Or to put a breakpoint in the
catch { }statement to inspect the state of your application at that stage, but as I understood it may not be applicable in the case you are describing.(By the way, I suggest you add the tag “Java” to your question. This way it will also be visible by the Java community of StackOverflow)