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
lnryanlnryan 

System Log - Filtering for System.debug() elements

How do I go about filtering out these kind of messages (ie every last method entry /exit line in all of Apex-dom):

19:24:28.435|METHOD_ENTRY|[1,15]|DateTime.newInstance(Integer, Integer, Integer) 19:24:28.436|METHOD_EXIT|[1,15]|newInstance(Integer, Integer, Integer) 19:24:28.436|METHOD_ENTRY|[2,15]|DateTime.newInstance(Integer, Integer, Integer) 19:24:28.436|METHOD_EXIT|[2,15]|newInstance(Integer, Integer, Integer)

 

So that I don't get this:

 

*********** MAXIMUM DEBUG LOG SIZE REACHED ***********

 

Before the debug log gets to what I really want, which is:

 

 

19:20:27.907|USER_DEBUG|[45,1]|DEBUG|My custom debug message

 

 

and:

 

 

Number of SOQL queries: 2 out of 100 Number of query rows: 6052 out of 10000 ******* CLOSE TO LIMIT Number of SOSL queries: 0 out of 20 Number of DML statements: 1 out of 100 Number of DML rows: 1513 out of 10000 Number of script statements: 10605 out of 200000

 

???

 

I'd also love to know how to filter for custom method / class entries and exits without having to wade through method / class entries and exits for say new Account() and MAP:String,SOBJECT:get(). Is it possible?

 

 

Thanks!

AlexPHPAlexPHP

I'd also like for there to not be a MAX size for the log, at least to have an option to get the full log.

 

To try to avoid this, especially for debugging purposes, if you are running unit tests, try to run just that one test class from the Force.com IDE.  You can do this by right clicking on the test class that you want to run -> Force.com -> Run Tests.

 

Further, I would limit the test methods that are ran in order to isolate the log to just the component I'm debugging.  So comment out the other tests to avoid cluttering the log.

 

You may also want to try changing the Log level in your Force.com IDE.  I've tried doing this, but still ran into the MAXIMUM.  Give it a try to see if it would help in your circumstance.

 

Lastly, to filter for MY debug messages, I don't know if others do this, but I put some specific characters before my log statement so that I can search/filter/grep for them afterwards.

  

System.debug('#####mylog message');

 

Let us all know if you find a good method for dealing with this. 

 

MiddhaMiddha

This has been added as an idea. Please promote this: http://sites.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=087300000007rm4