System.debug(JSON.Serialize(o)) Not longer shows full string

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);

The code is called from a method defined in a VF page action attribute.

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 –

Some Suggestions:

  • The Apex Replay Debugger is a powerful debugging tool – Note Seems to have issues with very large debug logs.
  • Checkpoints can be used to inspect objects at given points in code using the developer console.
  • Apex Interactive Debugger – This has become my personal favorite debugging tool.

Source : Link , Question Author : gNerb , Answer Author : gNerb

Leave a Comment