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
jonpilarski1.3914448382645588E12jonpilarski1.3914448382645588E12 

HOw to see system.debug in debug log

Hi,

I am trying to debug an Apex trigger in my sandbox. I have serveral System.debug statements which I see fime using Developer Console but I need to see them in debug log as I am running an integration API. I have modified the debug log filters (see below) but never see the debug.

Here I have changed filter on APEX_CODE to FInest and Debug but no System.debug statements are presented.


14.0 APEX_CODE,FINEST
12:33:57.054 (54988000)|ENTERING_MANAGED_PKG|TargetX_SRMb
12:33:57.055 (55190000)|HEAP_ALLOCATE|[71]|Bytes:3
12:33:57.055 (55220000)|HEAP_ALLOCATE|[76]|Bytes:152
12:33:57.055 (55241000)|HEAP_ALLOCATE|[272]|Bytes:408
12:33:57.055 (55266000)|HEAP_ALLOCATE|[285]|Bytes:408
12:33:57.055 (55290000)|HEAP_ALLOCATE|[379]|Bytes:48
12:33:57.055 (55332000)|HEAP_ALLOCATE|[131]|Bytes:6
12:33:57.055 (55406000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
12:33:57.055 (55418000)|VARIABLE_SCOPE_BEGIN|[1]|this|TargetX_SRMb.setFeeWaiverInfo|true|false
12:33:57.055 (55462000)|VARIABLE_ASSIGNMENT|[1]|this|{}|0x3497f74
12:33:57.055 (55685000)|HEAP_ALLOCATE|[50]|Bytes:5
12:33:57.055 (55714000)|HEAP_ALLOCATE|[56]|Bytes:5
12:33:57.055 (55725000)|HEAP_ALLOCATE|[63]|Bytes:7
12:33:57.059 (59123000)|CODE_UNIT_STARTED|[EXTERNAL]|01qf00000000DRe|studentStage on Application trigger event BeforeUpdate for [a00f0000004fGKb, a00f00000051SDX]
12:33:57.059 (59141000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:12
12:33:57.059 (59147000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:12
12:33:57.059 (59179000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:37
12:33:57.059 (59190000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4
12:33:57.059 (59200000)|VARIABLE_SCOPE_BEGIN|[1]|this|studentStage|true|false
12:33:57.059 (59219000)|VARIABLE_ASSIGNMENT|[1]|this|{}|0x628e4d06
12:33:57.059 (59233000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4
12:33:57.059 (59241000)|VARIABLE_SCOPE_BEGIN|[1]|this|studentStage|true|false
12:33:57.059 (59252000)|VARIABLE_ASSIGNMENT|[1]|this|{}|0x628e4d06
12:33:57.059 (59259000)|STATEMENT_EXECUTE|[1]
12:33:57.059 (59269000)|STATEMENT_EXECUTE|[4]
12:33:57.059 (59302000)|CODE_UNIT_FINISHED|studentStage on Application trigger event BeforeUpdate for [a00f0000004fGKb, a00f00000051SDX]
12:33:57.098 (98416000)|ENTERING_MANAGED_PKG|TargetX_SRMb
12:33:57.098 (98490000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
12:33:57.098 (98502000)|VARIABLE_SCOPE_BEGIN|[1]|this|TargetX_SRMb.EnrollmentDepositTrigger|true|false
12:33:57.098 (98545000)|VARIABLE_ASSIGNMENT|[1]|this|{}|0x4f071cdc
12:33:57.101 (101745000)|ENTERING_MANAGED_PKG|TargetX_SRMb
12:33:57.101 (101808000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:12
12:33:57.101 (101818000)|VARIABLE_SCOPE_BEGIN|[1]|this|TargetX_SRMb.ApplicationInsertTrigger|true|false


14.0 APEX_CODE,DEBUG
12:35:30.068 (68106000)|ENTERING_MANAGED_PKG|TargetX_SRMb
12:35:30.070 (70783000)|CODE_UNIT_STARTED|[EXTERNAL]|01qf00000000DRe|studentStage on Application trigger event BeforeUpdate for [a00f0000004fGKb, a00f00000051SDX]
12:35:30.070 (70883000)|CODE_UNIT_FINISHED|studentStage on Application trigger event BeforeUpdate for [a00f0000004fGKb, a00f00000051SDX]
12:35:30.094 (94490000)|ENTERING_MANAGED_PKG|TargetX_SRMb
12:35:30.097 (97310000)|ENTERING_MANAGED_PKG|TargetX_SRMb

Thanks

Jon
hitesh90hitesh90
Hello,

you have to write system.debug like below and try to find out (Ctrl+F) @@@@@@@. here instead of @ you can use any of the string or special character to put a flag. so you can find easily. this is the simple method to find out debug point from log.

system.debug('@@@@@@@@');

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
Email :- hiteshpatel.aspl@gmail.com
My Blog:- http://mrjavascript.blogspot.in/
Ravi BRavi B
You have to write some text like " For testing purpose" in system.debugg search with same text in log file
it may helps u

Thanks
Ravi B
Jerry ClifftJerry Clifft
You need to use System.debug.. here is a quick sample:

trigger xyz on CustomObject__c (After Insert, After Update) {  

    Set<Id> oppId=new Set<Id>();
    Set<Id> eqId=new Set<Id>();
    for( CA1:Trigger.New)    {
        oppId.add(CA1.Opportunity__c);
        eqId.add(CA1.Id);

        Map<Id,Opportunity> opptyMap=new  Map<Id,Opportunity> ([select Id,  wheverotherfields__c  from Opportunity where Id in :oppId ]);
            System.debug('Map Opportunity Size '+opptymap.size());
            System.debug('=== contents of opptymap: ' +opptymap);



Those bottom two lines will do it. The first will count the size of the map, the second will list the contents of the map. You do the same thing for lists, strings etc...