4

I am trying to debug an issue on my code and all of a sudden when i check my debug logs i cant seem to find the debug statements i had put in.

 System.debug('##################### START ############################' );

On a closer examination i found a line in debug logs

* Skipped 7397754 bytes of detailed log

How can i get a complete log to check the debug statements?

PS: My log size is > 2MB

  • 1
    I might be wrong but I was under the impression that when you get that message it's because the logs that are being skipped don't contain anything 'new' to say it that way. They are just a repetition with different(id's) of what you already can see, for example a long list of records. In my experience, if your debug messages are not showing it's because you have put them in a section that is not being executed. – PepeFloyd Oct 20 '12 at 18:44
7

You can also set your logging level using the Developer Console, I generally use Developer Console for debugging and use the 'Open Raw Log', much easier to read I find. Leave Developer Console open whilst you run your code and you get the debug logs for free. Not sure if there is a down side to this, but I find it quicker than Monitoring->Debug Logs:

enter image description here

  • My only concern here is that i dont get option of none here in developer console. – Mohith Shrivastava Oct 20 '12 at 18:08
  • Yep, there is that - I guess it comes down to personal preference at the end of the day. One other + for dev console is the ability to save your perspectives, so I have one called 'log only' which only displays minimal info. – Phil Hawthorn Oct 20 '12 at 18:42
4

Since you may need to inspect only system.debug statements you may switch off other log categories with log levels as none except the for the Apex and you can set it to Debug.Remember log levels are cumulative as well.So debug will include erorr and Warn too.

Following snapshots may help you in figuring how to approach this

enter image description here

enter image description here

2

Your log will need to be significantly smaller as the skipped section is over 7MB.

One way to reduced the log size is to adjust the logging levels. See Setting Debug Log Filters.

You could keep the Apex Code Log Level set to DEBUG and then reduce the other categories to be off.

In addition to the Skipped X bytes of detailed log message, check the end of the log to see if it ends with MAXIMUM DEBUG LOG SIZE REACHED.

  • 1
    If it's just the output from your System.debug you're after, you could also use System.debug( LoggingLevel.INFO, 'message' ); and set your filters accordingly. This will output much less 'noise'. – Phil Hawthorn Oct 20 '12 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.