113
votes
Accepted
Error while updating debug log trace flag
I have faced this issue, which I fixed it by deleting all debugs logs from developer console.
In dev console, Select tab "Query Editor" at the bottom of the console
Select check box "Use Tooling API"...
39
votes
Accepted
How do I see debug logs for Platform Event triggers in Salesforce?
From Christopher Marzilli via twitter:
when you go into setup to create a new trace you should see an option for "Traced Entity Type" select Automated Process.
It appears that Summer '17 ...
32
votes
Accepted
How do I debug my lightning component?
General Tools and settings:
use Chrome + built in Dev Tools + Lightning Component Inspector
be sure debug mode is enabled in your org (Setup: Lightning Components)
be sure caching is disabled in your ...
31
votes
Apex debugging in Winter '16 - how well does it work?
Some points from the DF15 presentation that Nate linked to.
You can only have 2 active debugger threads in an Org.
You can't, currently, debug asynchronous code (some allowances for test contexts)
It'...
27
votes
Accepted
Avoid Proxy objects in debug statements for a Lightning component
This will get it out of proxy and back into nice, readable format.
console.log(JSON.parse(JSON.stringify(myObject)));
Used it so much I made a snippet of it (vscode, sublime, maybe others)
"xlog": {...
26
votes
Accepted
Debug logs not working for Site Guest Users (Force.com sites) after the Winter 17 release
The answer we received from Salesforce Tech support is that before the Winter 17 release, if you turned on debugging for a Site Guest User, you might receive an avalanche of debug logs if many ...
21
votes
Accepted
System.debug() not displaying in debug logs
There are few things that you need to check.
In your debug level check in Apex code debug is set
Second check your debug log size if its 2MB <= then SF skip the Debug statement in that case set ...
19
votes
Accepted
How are we supposed to use debug logs for a specific Apex class only
Realistically, all you can do is set the user trace flags to a debug level with all levels set to "none", then set the class's log to a debug level that you want. Yes, you'll still be generating a ton ...
16
votes
Apex debugging in Winter '16 - how well does it work?
The answer I got from My Account Executive:
The cost is 18,000 USD a year and it requires some internal approvals before it can be sold...
16
votes
Accepted
Apex debugging in Winter '16 - how well does it work?
I convinced my PM that I needed the debugger for my recent project. I have not really used it much however, as I ended up doing so much front end work.
Also, with lots of unit tests, you don't need it ...
16
votes
Console.log truncates my debug `...}`
[UPDATE 2022]: This is no longer true (for some time already), see
other answers.
This is a feature (although in this case you may not view it as such, understandably) of the built in toString on ...
16
votes
Avoid Proxy objects in debug statements for a Lightning component
Here is how I generally work in chrome when i see a proxy object,
Use the chrome "store as global variable" on the proxy object as shown in the below screenshot
Then I just use the Javascript object....
16
votes
Accepted
Developer Console suddenly truncating System.Debug output
Sounds like they added something to the Dev console to truncate long lines in spring 19 (On March 20, 2019 according to the Release Note changes).
Developer Console: String Values in Debug Logs Are ...
15
votes
How do I start to debug my own Apex code?
I've added an Apex debugger to Illuminated Cloud that allows you to step through code, see variable values, etc. It uses information from debug logs and checkpoints to "replay" the executed process, ...
14
votes
Console.log truncates my debug `...}`
The JSON.serialize(...) trick no longer works, if one needs un-truncated messages following wrapper class is what I use, I just paste it as helper method at bottom of the apex class in those ...
13
votes
How can I get a debug log for the sites guest user/public profile? [updated for Spring 18]
Adding to Shane's answer-
The release notes which were linked to above include specific instructions for setting the cookie in Chrome, but not in Firefox. Here's one way of doing it in Firefox:
...
13
votes
Accepted
Different values from URL.getSalesforceBaseUrl().toExternalForm()
In Winter 19, we will have a new method, System.Url.getOrgDomainUrl(), which will always return the correct URL.
Use the new System.Url.getOrgDomainUrl() method to interact with Salesforce REST and ...
12
votes
Apex debugging in Winter '16 - how well does it work?
Not an answer:
But here's the DF15 presentation:
https://www.youtube.com/watch?v=O2TvQ3rtpV0
As mentioned at 18:30 it's an add on product (for purchase).
12
votes
How can I get a debug log for the sites guest user/public profile? [updated for Spring 18]
Chrome & Edge
The above answers are not so clear instructions for winter 17 release .For winter 17 release open the public site first by clicking on the links in the Develop | Sites | Site
And ...
12
votes
Accepted
How to get running class and method names programmatically?
Here's a fun fact to get the ball rolling: the constructor for any Exception class will generate the current stack trace (no need to throw). So you can, for instance, get the stack trace in your ...
12
votes
Error while updating debug log trace flag
The short term solution is to keep playing whack-a-mole~ApexLog as Pranay has suggested.
Longer term, the problem comes back to the Summer'18 update Store Larger Debug Logs with Changed Log Limits:
...
10
votes
Accepted
Is there any way via any API to track Metadata history?
Starting with Winter'16 the SetupAuditTrail object has now been exposed via the Salesforce API's and within Apex via SOQL. Its pretty much a mirror of the CSV download, accept for the Delegate User (...
10
votes
Console.log truncates my debug `...}`
If you are debugging large objects or lists, enclosing your debug contents with JSON.serializePretty(), eg:
system.debug(JSON.serializePretty(hugeAccountList));
will insert line breaks, which allow ...
10
votes
Accepted
Count of SOQL Statements used in Debug logs
It's the Limits class:
Integer queriesUsed = Limits.getQueries();
10
votes
Accepted
Debug Log Traced Entity Type Apex Class
You need to also set a TraceFlag on the user you want to trace. A TraceFlag set on a class only overrides the TraceFlag settings for the user; you use them together to get detailed analysis on a ...
10
votes
Accepted
is there a way to check a debug statement belongs to which class
Open the log in dev console and select Debug Only. Then select the columns File and Method
In the above image, File corresponds to the Id of class which can be opened directly from url with /<--Id-...
9
votes
Accepted
Why do debug logs not always work for a @future method?
The problem was -- I was executing anonymous code and checking the "Open Log" option. The call was actually generating two separate logs -- one for the anonymous code, and another for FutureHandler, ...
8
votes
Salesforce Developer Console - Getting a stack trace easily
@NSjonas answer is good. I thought I'd add some more options.
System.debug
It's not ideal, as you need to modify the code to use it. Try something like:
System.debug(LoggingLevel.Error, new ...
8
votes
Does debug log level increase CPU time?
In addition to agreeing with Santranu's "yes", also bear in mind that the logging calls themselves consume CPU time as the argument string has to be built whether is is stored or not.
We had logging ...
8
votes
Accepted
Where is the Lightning tab in the developer console?
Wrong Developer Console. While viewing the app or in LEX, press F12 to bring up the browser's Developer Console. It'll be far off on the right, you might need to click the >> arrow to see it.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
debugging × 347apex × 147
developer-console × 34
logging × 33
debug-logs × 32
debug × 31
trigger × 24
visualforce × 23
lightning-aura-components × 21
unit-test × 18
managed-package × 15
visual-workflow × 14
lightning-web-components × 12
salesforcedx × 10
javascript × 9
vs-code × 9
apex-debugger × 9
soql × 8
batch × 8
community × 7
force.com-sites × 6
isv × 6
lightning × 5
controller × 5
force.com × 5