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
Swagat.TusharSwagat.Tushar 

Inconsistent Debug Log/ Debug Log not showing

I am trying to log some values for my apex class(using system.debug) but the logs are just not printing.

This is what is happening:

  1. I am pressing a button that gets values from custom setting and update that values to a picklist field values usinf MetadataAPI.
  2. When the button action method runs, I am using System.debug to check the values.
  3. Confusingly, some of the logs are just not capturing. For example, I get the last debug statement result of the method, but not the first one (on the first line of the method). How can the last line print, but not the first?
  4. If I am doing the operation for small set of data then all debug statements are returning perfectly. The issue comes up when I do the operations for large volume of data(i.e. 1000 records)
Satish_SFDCSatish_SFDC
There is a 2 MB debug log limit. This might be one of the reasons.

Regards,
Satish Kumar
Swagat.TusharSwagat.Tushar
Hi Satish,

Does this affect also the operation I am doing. When I run my code for 50/100 records then the debug statement are coming fine and the updates I want to do also works fine.

But when I run my code for 1000 records then the debug statements are inconsistent and the updates to records also not happening.
Satish_SFDCSatish_SFDC
It never affects the operations.
Its just that the older log lines get deleted to make space for the newer log lines.
Swagat.TusharSwagat.Tushar
Thanks Satish,

However I observed that whenever there is Inconsistency in debug log(due to large volume of data operation) the operation is failing. No system exception though.

If the volume of data is small, then debug log is also fine and the operation I want to do also working perfectly.

More details about my problem here:
http://boards.developerforce.com/t5/Apex-Code-Development/Update-picklist-values-and-their-dependencies-using-Metadata-API/m-p/695685

Regards
Swagat