What is the Log level that should be set to see user-generated debug statements?
2 Answers
You can see user debug statements with log level "Debug" or higher:
Debug, Fine, Finer, Finest, Internal.
You don't see user debug statements in levels "Info" or lower:
Info, Warn, Error
-
2to avoid lots of noise in the debug logs; do what @sfdcfox suggests --
System.debug(LoggingLevel.INFO,'mymsg');
or useLoggingLevel.WARN
orLoggingLevel.ERROR
and then set your log filters in DC to Apex Code = INFO (or WARN or ERROR) and System = Error. You'll have shorter logs that are way easier to read– cropredyCommented Dec 2, 2015 at 17:54 -
3This answer is not correct. You can see USER_DEBUG messages at any level above NONE, as long as the System.debug statement is specified as equal to or higher than the current logging level.– sfdcfox ♦Commented Dec 3, 2015 at 18:19
-
In case it wasn't clear, I was referring to only the user debug statements generated from the single parameter version of system.debug()– martinCommented Dec 3, 2015 at 18:45
The minimum value to see any debug logs is a System level of ERROR, but most people only use the default logging level, so the usual recommendation is DEBUG. To debug at a lower level than debug, use the two parameter version of System.debug:
System.debug(LoggingLevel.ERROR, somemessage);
Also note, logs over 20mb may be truncated, including your debug messages.
USER_DEBUG
statements. Basically all you will get there are workflows, validation rules, and triggers (but not other classes that they call).