function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mikebr59mikebr59 

Can't get System.Debug messages to write to debug log

I'm absolutely tearing my hair out on this one. I have an Apex class with several System.Debug statements, which work fine in the Sandbox (Summer '12). But in production (Spring '12) the System.Debug statements in just one method aren't being written to the log. System.Debug statements elsewhere in the class work fine.

 

What I am seeing in the production debug log but not in the sandbox is a boatload of CONSTRUCTOR_ENTRY and CONSTRUCTOR_EXIT entries, associated with creation of an object (using "new"), which is immediately adjacent to the System.Debug statements that aren't working. So I know that section of code is being executed. So why am I getting CONSTRUCTOR_ENTRY/EXIT messages in the prodution log but not in sandbox, but I get USER_DEBUG messages in sandbox but not in production?

 

Again... I'm getting some System.Debug messages in the log. Just not from the method that I'm trying to debug. WHAT AM I MISSING???

Abhay AroraAbhay Arora

Try adding your user to the debug logs...

mikebr59mikebr59

Thanks, but as I think I made clear in my question, I'm already getting a debug log, including some of the System.Debug messages (just not the ones I need). My user is already added to the debug logs.

 

I should also have mentioned that the log filter settings are identical in sandbox and production.

JayNicJayNic

They've updated our sandboxes to preview summer 12... 

 

Some of my code is giving me crazy problems too!!!

 

I notice now if I do an "if (object.Lookup__c != null || object.Lookup__c != '') {}

 

 

it throws an "invalid id" exception!!!! the new dev console does not help...