• sf-dev-forum user
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello,

As part of our managed package we're using the standard Salesforce functionality Exception.getStackTraceString() to get the stacktrace of an exception as a String for better error handling and logging. We do not write this to a standard Salesforce debug log, but rather persist it in a custom SObject used for logging whenever an exception is thrown in our code. Unfortunately, the getStackTraceString() method seems to work differently depending on the org the package is installed in, i.e. we get full stacktraces for exactly one org but no stacktraces at all in all other orgs.

We could find no documentation in the official docs as to when stacktraces are produced or any possible settings for enabling/disabling stacktraces for managed packages except for the suggestion to log in as a supporter from the LMA org. This however does not solve our problem since we are logging exceptions proactively, i.e. whenever something goes wrong we persist a report in the client's org which is then read by our support team when they log in as a supporter later on. The org for which we get stacktraces has no login access granted, so it has to be some org specific configuration independent of support access.

Could someone from Salesforce perhaps shed some light on what exactly is happening when no login access is granted and a normal user triggers this code? We have already contacted our ISV Technical evangelist and he asked us to post the problem here in the forum and suggested we mention @Josh Kaplan. This feature is critical for being able to quickly fix bugs and any help would be greatly appreciated, especially since the logging already works perfectly in the one org I mentioned, so I assume that it must be possible in principle.

This is elaborates on our previous post: https://developer.salesforce.com/forums/ForumsMain?id=906F0000000DDXIIA4 - However, as explained, the suggestions here do not help us any further in retrieving the stack trace as a string upon inception. 

Kind regards,
Julius
Hello,

As part of my managed package I'm using the standard Salesforce functionality Exception.getStackTraceString() to get the stacktrace of an exception as a String for better error handling and logging. Unfortunately, this functionality seems to work differently depending on the org the package is installed in, i.e. I get full stacktraces for one org but no stacktraces at all in all other orgs.

There is no documentation in the official docs as to when stacktraces are produced or any possible settings for enabling/disabling stacktraces for managed packages. This feature is critical for being able to quickly fix bugs and any help would be greatly appreciated. 
Hello,

As part of my managed package I'm using the standard Salesforce functionality Exception.getStackTraceString() to get the stacktrace of an exception as a String for better error handling and logging. Unfortunately, this functionality seems to work differently depending on the org the package is installed in, i.e. I get full stacktraces for one org but no stacktraces at all in all other orgs.

There is no documentation in the official docs as to when stacktraces are produced or any possible settings for enabling/disabling stacktraces for managed packages. This feature is critical for being able to quickly fix bugs and any help would be greatly appreciated.