You need to sign in to do that
Don't have an account?
ketan vinodrai mehta
Read debug log details
Hi All,
I want to read entire record of a debug log in my code. I am able to query ApexLog object but the log description ("LOG") column is not available. Please do guide.
Thanks in advance,
Ketan Mehta
I want to read entire record of a debug log in my code. I am able to query ApexLog object but the log description ("LOG") column is not available. Please do guide.
Thanks in advance,
Ketan Mehta
Almost 3 years too late, but just thought I'd save someone's time if they stumble upon this question like I did.
As explained in this SO topic (https://salesforce.stackexchange.com/a/216917), you cannot access the body of the ApexLog directly, but rather have to query it via REST API.
So to read contents of the log file in apex class, you would have to first query the ApexLog record with SOQL, then retrieve the contents of the log file with REST request, like so:
All Answers
If you use operation in your query i think you will get description as
Name of the operation that triggered the debug log, such as APEXSOAP, Apex Sharing Recalculation, and so on.
Please refer below links to know which can be used for ApexLog object.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_apexlog.htm
Hope this helps you!
Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
Thanks and Regards
Sandhya
Thanks for the answer. I have tried all the fields documented by SFDC on APEXLOG class and it is not available. Is there something I am missing?
Almost 3 years too late, but just thought I'd save someone's time if they stumble upon this question like I did.
As explained in this SO topic (https://salesforce.stackexchange.com/a/216917), you cannot access the body of the ApexLog directly, but rather have to query it via REST API.
So to read contents of the log file in apex class, you would have to first query the ApexLog record with SOQL, then retrieve the contents of the log file with REST request, like so: