12

I wanted to set the debug log to test a class but today after few days when I was trying to set it, I saw its new look and feel in winter'16 release. It asked for event, level etc. I am unable to set the "Debug Level". I have no idea what value to provide there. Can anyone help me in explaining how to set it as It is a mandatory field :-(

enter image description here

Thanks! Ruchi

  • 3
    Click new in the lookup screen and you will see you build your own "presets" – Girbot Sep 17 '15 at 12:57
  • The new mandatory field is confusing. The answers to this question did not help me, but the comment by @Girbot was perfect. Thanks! Still confusing though: I added a new level named DEFAULT and it created a log with type USER_DEBUG. Hmm... – Sander de Jong Oct 29 '15 at 8:28
  • 1
    Yeah, the debug log is a tattered mess right now - I suppose that's good in a way - means they must be doing some work on it. – Caspar Harmer Jun 27 '16 at 22:36
6

The debug log got a new name(i think) as Trace Flag.

Few Points to note:

  1. The trace flag can be set to any User, Apex Class or Apex Trigger.
  2. The trace flag can be set to a specific time interval which can be set by specifying the stare date and expiration date. The minimum interval is half hour and can be set to a maximum of 24 hours.
  3. The Debug Level can be created with specific log levels for each category(Apex, Visualforce, Workflow, etc.,). You can create multiple Debug level one for very fine grained logs with all logs, one for very minimal logs with none in all category. You can create new Debug level by clicking New in the lookup window(Couldn't find any other place to create Debug level other than this).
  4. Once the expiration date passed, no logs will be captured for the User, Apex Class or Apex Trigger. But the trace flag will be available so you can change the Start Date and Expiration Date and the logs will be captured for the interval.

Now lets discuss about the real time scenario where the trace flag gets advantage over older debug logs.

Debug logs can capture only 20 logs. You have to click Reset to reset it to start to capture another 20 logs. If you have put the debug logs for an end user and try to capture the logs, you have to repeatedly reset the logs to capture all the logs which is very very cumbersome.

But in trace flags, once you set an interval, all the events happened between that interval will be captured in debug logs with the Debug Level we specified.

Finally, it will be little difficult for moving over from Debug Logs to Trace Flags but the change is healthy and lets the Administrators and Developers debug the issues more quickly and efficiently.

5

In brief, Debug level is a reusable debug log setting.

A debug level is a set of log levels for debug log categories: Database, Workflow, Validation, and so on. A trace flag includes a debug level, a start time, an end time, and a log type. The log types are DEVELOPER_LOG, USER_DEBUG, and CLASS_TRACING.

When you open the Developer Console, it sets a DEVELOPER_LOG trace flag to log your activities. USER_DEBUG trace flags cause logging of an individual user’s activities. CLASS_TRACING trace flags override logging levels for Apex classes and triggers, but don’t generate logs.

More info can be found here

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.