You need to sign in to do that
Don't have an account?
TehNrd
Please fix the Debug Log!
When Apex code was first released the debug log worked wonderfully! It displayed all relevant Apex info, limits, debug statements, etc.
The new version not so much. When I am working with Apex code I could care less about workflow criteria evaluations. These do nothing but get in the way and make the debug log ridiculously long. For us this is making the debug log so long it is cutting off the top of the log and with that lots of my debug statements. This has made debugging Apex extremely tedious and very painful.
With the new version you are supposed to be able to modify the logging level but this rarely works. It's as if it has a mind of its own.
Sorry for the somewhat harsh tone but it has been very frustrating digging through literally 35,000 lines of workflow evaluations only to find that my debug statements are not there.
Message Edited by TehNrd on 07-17-2008 03:34 PM
The new version not so much. When I am working with Apex code I could care less about workflow criteria evaluations. These do nothing but get in the way and make the debug log ridiculously long. For us this is making the debug log so long it is cutting off the top of the log and with that lots of my debug statements. This has made debugging Apex extremely tedious and very painful.
With the new version you are supposed to be able to modify the logging level but this rarely works. It's as if it has a mind of its own.
Sorry for the somewhat harsh tone but it has been very frustrating digging through literally 35,000 lines of workflow evaluations only to find that my debug statements are not there.
Message Edited by TehNrd on 07-17-2008 03:34 PM
Yes, indeed it is frustrating.
I now use the System.ASSERT(false, 'My old debug statement') to output what I want. However downside is it stops at the first statement!
In past I was occasionally able to skip a lot of junk by some careful sequence of steps - set log category and log level to none and then set log category to debug and log level to debug as well...I don't think it works anymore.
The big issue for me is that I can’t get the output of System.debug() statements without also getting METHOD_ENTRY/EXIT spew (as both are in the “Apex Code : DEBUG” level).
I think System.debug() statements should be placed into a separate Log Level than METHOD_ENTRY/EXIT. Perhaps METHOD_ENTRY/EXIT should be moved into the “Fine” log level.
Note the Log Level-vs-Events issue is confused, because there isn’t an Event for System.debug() statements – they show up at DEBUG, but the System Log’s “Events” list only adds METHOD_ENTRY/EXIT when you go from “INFO” to “DEBUG”.
Also, it would be useful to break METHOD_ENTRY/EXIT into USER_METHOD_ENTRY/EXIT and SYSTEM_METHOD_ENTRY/EXIT. The first only traces non-System methods; the second traces system methods. They should be placed in “FINE” and “FINER” levels, respectively.
So I'm asking for three things:
1. An Event for System.Debug which is distinct from METHOD_ENTRY/EXIT.
2. Split METHOD_ENTRY/EXIT into USER_ and SYSTEM_ flavors.
2. Keep System.Debug in the 'DEBUG' leve, put USER_METHOD into "FINE", and put SYSTEM_METHOD into "FINER".
I guess it wouldn't hurt to link to my blog post expanding on the issues of the current debug log:
http://www.tehnrd.com/if-computers-could-barf-salesforce-debug-log/
One thing I have found to be very helpful to overcome many of the issues discussed in this thread is to set the log level in my system.debug call to something 'higher' in importance than just debug. For example:
System.debug(Logginglevel.WARN, 'Information I want to see in the log' );
will cause the debug statement to output at the 'Warn' level. Then, I set the debug level for Apex code to 'Warn'. This will eliminate all the noisy debug output that you get at the debug level, while outputting the specific statements from my code.
Hope this helps.
Good point. I had been hoping to get "old behavior" without code change, but it's probably not possible.
Please vote up this Idea to add a filter
http://sites.secure.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=087300000007rm4AAA
I tried setting the debug log filters to NONE and I still see ALL of the debugging info (method entry, method edit, sql, etc. etc ... all of it. Not a thing is hidden.) Can someone please tell me what I'm missing? This is very frustrating.
I tried changing the filter in "System Log" and also tried it in "Setup > Monitoring > Debug Logs." Both gave the same result ... I see all information for everything in the debug log.
Is there something obvious I'm missing, like a "save" button for the filter settings?
I don't see a save button for the filter settings on either page so I don't even know if it's saving my changes. It does a postback when I change a setting, but there's no change in the level of information logged.
I'm trying to set it up so that I can set the log level to NONE for everything except Apex code, which would be set to WARN, and then I would use LoggingLevel.WARN in my system.debug() statements.
It seems to be sort of filtering now (maybe a flaky postback last time when I changed the filter settings?)
But I still see CODE_UNIT_FINISHED and CODE_UNIT_STARTED events with Apex Code set to WARN. Is there a way to hide those events? It's still very cluttery.