Skip to main content
F K a posé une question dans #Apex
This week I started receiving errors that "Your Salesforce org reached the debug log generation limit"  It seems that Trace Flags are being automatically created under my name.  I've searched the help and can only find how to manually create a trace flag.   It does seem that this may be happening whenever batch processess are run.  

I'm just unsure of how to stop them if they are automatically being triggered by code.  THe other thing that is puzzling is that we have not changed anything this week.

Any help would be greatly appreciate!! thanks!!!

Fred
5 réponses
  1. 16 août 2018, 17:05
    Hi Fred,

    Create one batch class and schedule it. every day or based on hours also.

    Sample code : 

     

    Global class BatchMassDeleteRecs Implements Database.batchable<sobject>{

    global final string query = 'SELECt ID from APEXLOG';

    global Database.QueryLocator start(Database.BatchableContext BC){

    return Database.getQueryLocator('query');

    }

    global void execute(Database.BatchableContext BC,List<SObject> scope){

    delete scope;

    }

    global void finish(Database.BatchableContext BC){

    }

    }

    Hope this helps you!

    Thanks

    Varaprasad

    @For  Support: varaprasad4sfdc@gmail.com

    Blog : http://salesforceprasad.blogspot.com/

     
0/9000