For the longest time I have been using
System.debug(JSON.Serialize(o))to output objects to the debug log for troubleshooting purposes. This has worked up until my most recent project. Even existing code seems to be having this behavior.
I’ve tested API versions 41-45 with no luck. The actual line of code I’m using is:
system.debug(json.serialize(accountsToInsert)); // This is a map
I have also tried:
Account test = accountsToInsert.get(Key); system.debug(json.serialize(test));
The code is called from a method defined in a VF page
Is this just a thing that we have to live with now? Is there another way to get a full look into the state of an object at run time?
Unfortunately, since Spring’19 in order to improve performance, Salesforce changed a way how long strings are shown in the Developers Console.
Now strings are now truncated at 512 characters in the Developer Console’s Log Inspector
In order to retrieve full log, it is needed to use Open Raw Log in Developers Console menu.
Release notes with more information – https://releasenotes.docs.salesforce.com/en-us/spring19/release-notes/rn_forcecom_developer_console.htm