I have an Apex Batch Class that I'm trying to view the debug logs for. I know that I can do this in the Dev Console, but the data and amount of logs its returning is causing the Dev Console to freeze.
The approach I decided to take was create a TraceFlag for the class, but it appears that this doesn't actually save the logs for the class execution:
Class and trigger trace flags override other logging levels, including logging levels set by user trace flags, but they don’t cause logging to occur.
Source: (TraceFlag Help page)
I interpret this to mean that trace flags on ApexClasses do not actually save any of the logs of an apex class. Am correct in my understanding that you can only save logs at the user level?
Is there a recommended way to retrieve the logs for an Apex Class, specifically a Batch Class.
Thanks!
Best Answer
As you quoted, simply setting a class trace flag won't create a log. However, setting a user trace flag will and the class trace will override the user trace levels.
As explained in this helpful answer, the best you can do is the following:
Now, you're left with logs getting created that would have very little to nothing (the user trace) and logs with actual information that would be the info related to the class trace.