I am aware that managed package logs are not shown in the installer org however you could access them using LMA. I'm still in the initial development phase and hence can't use that. I am using custom logging to capture logs.

  • I wanted to know what are the best practices for adding debug statements to managed package?
  • What kind of debug logs are flagged during the security review?
up vote 1 down vote accepted

Never show sensitive data inside debug logs like username or password or email ,SSN etc. They will be flagged by security review .

The other thing to consider is have a custom setting thats protected and can be easily switched to show some logs. You can use this to only turn logging during issues and then turn it off .Adding debug logs also affects performance minutely.

  • Thanks for your comment. I'm using custom settings for enabling debug level logs and can flip it. I had some follow up questions: Are record Ids display ok in the debug statements? How about printing different record fields? Is there a guideline of what can/cannot be printed? Thanks again – gerad26 Mar 1 '17 at 12:26
  • RecordIds are fine .There is no written guideline anywhere. RecordIDs will be anyways protected by profile settings so you should be fine – Mohith Shrivastava Mar 1 '17 at 12:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.