+ Start a Discussion

Saving the debug log data to other object in Salesforce

The time to execute the code can be maintained in Debug Log with other details also. But it can be stored for 20 execution only..


Is there any way to store debug log data into some other object in database? I require this information to calculate the performance. Can anyone suggest me that how to implement this

Ankit AroraAnkit Arora

I hope after 20 executions you need to recreate the debug logs, and you want more debug logs to be stored there.


So just do one thing after you create a debug just click on reset, after that more than 20 debugs(around 200) will be stored. So you don't need to recreate it.



Ankit Arora

Blog | Facebook | Blog Page




I have just verified in Schema, There is an object called ApexLog which might be useful for your extract.

Please check this.




Ankit AroraAnkit Arora

If you just want to keep track of debug logs for the time beaing then I would suggest not to go with using apex.




Ankit Arora

Blog | Facebook | Blog Page

Shashikant SharmaShashikant Sharma

Just see this




But these logs will only come in query for 60 minutes from there creation.

If you want to see debug logs later save the files on your org, save as html. Why to save it in any other object.


I think it may not possible.

A debug log records database operations, system processes, and errors that occur when executing a transaction or while running unit tests. The system generates a debug log for a user every time that user executes a transaction that is included in the filter criteria.

Its only to show the result of specific operation.