+ Start a Discussion

system.debug statements not appearing in the debug log

I am fairly new to Apex Development and am trying to debug some code developed by a senior level developer.
The code is a controller extension that errors with a SOQL limit without completing so the page is not completed.

I added system.debug statements to some of the methods in the code, turned on debug for my user and many different levels of debug but my system.debug statements fail to appear in the debug logs.  Based on other detailed entries in the debug log I have confirmed that the code where I've added system.debug is being executed.

Any suggestions?   I'm probably making a very simple/common beginner mistake.

Best Answer chosen by debra
Try adding System.debug(LoggingLevel.Info, 'Your info');

All Answers

Try adding System.debug(LoggingLevel.Info, 'Your info');
This was selected as the best answer
Thanks for the suggestion.  Added the LoggingLevel parameter worked like  charm!
Richard DiNardo 6Richard DiNardo 6
Why do I only need the LoggingLevel.Info sometimes? I write it all the time with out the first parameter and it works fine. Today it doesn't and I have to add the first logginglevel parameter. Why is this sporadic?
I am still facing issue, My all code is working fine but System.debug('Text') is not displaying anything on the Debug screen. Can you please help me?