If you are someone with at least one managed package developed in Salesforce, then you would have surely got the chance to log into your subscriber’s org and then debug an issue for the client. This becomes quite complicated as the code is not visible in the subscriber org, and if you’ll open the developer console then also the debug logs will be masked. No debugged lines will be visible and the only option you have is to analyze everything, get an idea of what the problem might be. Well, luckily Salesforce gives us an option to see the debug logs of our package in the subscriber org. This is what we will see how to view your debug logs in subscriber org.

The process

Here I am assuming that you know everything about the subscriber tab in License Management App (LMA). This is the tab that is used to see all your subscribers, i.e. people who have installed at least one of your packages. All you need now is the login access of the client whose org you want to login and debug.

Always remember to ask for the client to provide you login from the grant login access option. Never take their username and passwords to login in their orgs.

For this example, I’ll be having both the login access and the subscriber org’s credentials, as the subscriber org is my own developer org.

Direct Login

First, we need to login into the developer org directly. Here I have one of our package installed in the org, ‘Events Reminder’. This package is used to see the upcoming birthdays, anniversaries and other events, defined in its functionality, in the org. I’ll schedule a job from events reminders and check the log.

First I’ll set a cron job from my application and check if it is created properly:

As you can see here that the job has been successfully set. Next, go to the developer logs from setup and create a trace.

Finally, wait for the job to execute and then refresh the page. After the page has been refreshed a new log will be created which you can view. Click on the button and you’ll see that the log is something like this.

Subscriber Login

As we can see in the above section that the log is not at all informative. It tells nothing, and to see the code we need to login as the owner of the package. For this method ask your subscriber to provide you login access for the number of days that you’ll need for debugging. Then login in the org from the subscriber overview page and repeat the steps in the previous method.

Reset the log again, as the old log is set by the User of the org. This time you’ll see that the requested by column will show the name of one of the apps that the subscriber has installed. Now go to

Upon viewing the log you’ll see that the entire log is like the one you see in the developer console. As This log contains the managed code of our application so I cannot show this log here. However, this method will work for any of your apps.

Support

That’s all about viewing debug logs in subscriber org in Salesforce, for any further queries feel free to contact us at:

https://wedgecommerce.com/contact-us/

Or let us know your views about this blog in the comments section below.

Leave A Reply

Please verify that you are not a robot.

Tell us about Your Company

How can we help you with your business?




    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home