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"...
53
votes
Delete all in Debug log
Now that we have SFDX, I use the below method to delete debug logs from terminal:
$ sfdx force:data:soql:query -t -q "SELECT Id FROM ApexLog" -r "csv" > out.csv
$ sfdx force:...
34
votes
Accepted
Delete all in Debug log
SELECt ID from APEXLOG and run this query in DC Query Editior and select the tooling API checkbox.
Now Delete all the records. It will solve your problem and this is a native solution.
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 ...
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 ...
17
votes
Accepted
DateTime.format() unexpected behavior
Actually... the datetime format is right.
The capital Y merge field is the WEEK YEAR - which from the 27th December 2015 is IN 2016!
The lower case y merge field is the CALENDAR YEAR - which will be ...
15
votes
Accepted
Salesforce doesn't show debug logs
have seen this behavior many times in multiple orgs (logs do exist in the dev console though). Just waiting for SF to figure it out and fix it. Since one cannot report anything without being directed ...
14
votes
Delete all in Debug log
I had an org with over 400mb of logs that needed to be cleared! The Salesforce developer tools only lets you delete 2000 rows at a time and the process has to be manually repeated.
So instead I ...
14
votes
Salesforce doesn't show debug logs
Just in case it is helpful, you can also directly query for the Debug logs yourself using ApexLog. It's accessible in both the Partner API and the Tooling API. You would typically filter the ApexLog ...
13
votes
Accepted
Is it possible to get current line number in Apex?
Put the following function in some class somewhere:
public static Integer currentLineNumber() {
try {
Integer x = 0 / 0;
} catch(Exception e) {
String line2 = e....
12
votes
Delete all in Debug log
Use apex debugger chrome extensions. There you can select debug size. for example select 5000 and delete all the debugs. Great tool
Chrome extensions
Apex Debugger
Salesforce Coding Utility
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:
...
11
votes
How to print ALL the elements of a List<>?
You could use JSON serialization to format all the records in the collection.
E.g.
List<Account> accs = new List<Account>();
for(integer i = 0; i < 50; i++) {
accs.add(new ...
11
votes
Accepted
Adding a System.debug changes code behavior
Which is a bit unexpected for me as Accounts with different fields should result in a different hash. I know that using sObjects for map keys is bad practice but still interested in how adding a debug ...
10
votes
Accepted
Is it a good practice to set debug points in possible failure points in our Apex code?
Setting just system.debug won't help you much since in orgs where your package is installed might have lot of other codes that might lead to logs truncation and your debug statements getting lost.
...
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 ...
9
votes
Accepted
MAXIMUM DEBUG LOG SIZE REACHED
Generally speaking, you can control the logging level using the TraceFlags.
TraceFlags have overriding authority over all other tracing methods. See Summer '15 Release notes - Receive Debug Logs ...
8
votes
What is the Log level to see apex debug statements?
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 ...
8
votes
Accepted
Debug log is filled with USER_INFO
Ok, I had the same error, and after much digging, may have a solution.
In the debug log area, delete all logging levels and all traces.
Then in the dev console, do this query (using the tooling API):...
8
votes
Accepted
Writing too much to debug log increases heap and cpu time
Yes, this is expected, and perfectly normal. Each time you call System.debug, the object you pass in must serialized, even if the system eventually doesn't end up putting anything in to the log, and ...
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.
7
votes
How are we supposed to use debug logs for a specific Apex class only
The short answer is, you can't. The class specific debug levels only control how verbose the logging for those classes are.
When the user executes an action, all the classes within the same context ...
7
votes
Accepted
Mass delete Debug logs using Salesforce DX
The following worked for me
sfdx force:data:soql:query -q "SELECT Id FROM ApexLog" -r "csv" | out-file -encoding oem out.csv
sfdx force:data:bulk:delete -s ApexLog -f out.csv
With ...
7
votes
Accepted
Is there a way to create Trace Flags for certain user using SFDX?
Yes, you can create a Trace Flag via command line.
The command for creating a new Trace Flag:
sfdx force:data:record:create --sobjecttype TraceFlag -v "StartDate=$NOW ExpirationDate=$EXP ...
6
votes
Delete all in Debug log
I used the dataloader to export and delete all the debug logs. There were over 4K records so this was without a doubt the quickest way to do it. I chose the object ApexLog and used the following query:...
6
votes
Accepted
What is the 'INTERNAL' debug level?
I have been informed by technical support that R&D has investigated the issue, and that this value will be removed from the UI at some point. As such, we shouldn't use this value for debugging.
Community wiki
6
votes
Accepted
What is Debug level in new Salesforce Edition?
The debug log got a new name(i think) as Trace Flag.
Few Points to note:
The trace flag can be set to any User, Apex Class or Apex Trigger.
The trace flag can be set to a specific time interval ...
6
votes
Accepted
Debug logs in developer console?
In the Developer Console, uncheck "Show My Current Logs Only".
6
votes
Mass delete Debug logs using Salesforce DX
The following worked fine for me in MAC
sfdx force:data:soql:query -q "SELECT Id FROM ApexLog" --resultformat csv > out.csv
sfdx force:data:bulk:delete -s ApexLog -f out.csv
I have not ...
6
votes
Accepted
LWC - Debugging using devtools
There's a good blog post on debugging your LWC components that the below info is all taken from. I'll include the video walkthrough which is easy to follow along with and only 7 minutes long.
In ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
debug × 141apex × 49
debugging × 31
debug-logs × 19
logging × 11
visualforce × 10
developer-console × 8
trigger × 6
visual-workflow × 6
managed-package × 5
salesforcedx × 4
performance × 4
lightning-web-components × 3
unit-test × 3
community × 3
query × 3
json × 3
error × 3
force.com-sites × 3
list × 3
winter16 × 3
apex-debugger × 3
lightning-aura-components × 2
soql × 2
javascript × 2