4

I have a trigger called DistancesToShow that I see executing in a debug log. The trigger has a big if-then-else clause that can take it down many different paths. Based on the debug log, I can't quite tell which code path it's going down so I decided to add a bunch of debugging statements.

At the top of the trigger, right after some SOQL queries, I added the line:

System.Debug(LoggingLevel.Info,'>>>>>> inside DistancesToShow trigger');

I added several more System.Debug() messages at the top of each else clause to see which else I ended up in.

But no matter how many times I run it, I can't get it to display the message, even though it is definitely inside the trigger. I ran it a bunch of times trying to play with the different log levels, thinking I might not be understanding those. But at this point I'm logging everything and my simple debug messages aren't showing up.

I see that the trigger starts execution here:

CODE_UNIT_STARTED|[EXTERNAL]|01qi0000000Bn0P|DistancesToShow on Show trigger event AfterUpdate for [a023100000axfl7]

I then see three sets of SOQL_EXECUTE_BEGIN and SOQL_EXECUTE_END, each corresponding to an SOQL query I execute at the top of the trigger. Right below my last SOQL query is my System.Debug() message from above and it doesn't appear.

Why would my debug message not be appearing?

  • Debug will be visible in the logs, first you should share your code.. – Vicky Singh Sep 8 '16 at 5:59
12

There are few things that you need to check.

In your debug level check in Apex code debug is set enter image description here

Second check your debug log size if its 2MB <= then SF skip the Debug statement in that case set all unwanted flag to none so that it will reduce your debug size and then you can see the debug. Also add a debug in start so that it give you confirmation that your debug is printed.

  • 2
    That did it! My debug log size was > 2MB. I didn't realize it was just skipping the debug statement in that case. Thanks for your help! – eyedar Sep 8 '16 at 6:19
  • 1
    Where do you see log size? – Nathan Hinchey Jan 12 '18 at 17:01
  • @NathanHinchey its on debug log page. You will find the debug size in bytes. You need to convert them. – Tushar Sharma Jan 13 '18 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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