Skip to main content
117 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"...
Pranay Jaiswal's user avatar
57 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:...
javanoob's user avatar
  • 8,907
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 ...
Jph108's user avatar
  • 651
21 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 ...
sfdcfox's user avatar
  • 497k
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 ...
Eric's user avatar
  • 54.2k
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 ...
Daniel Sokolowski's user avatar
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 ...
Daniel Ballinger's user avatar
13 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: ...
Daniel Ballinger's user avatar
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 ...
sfdcfox's user avatar
  • 497k
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. ...
Mohith Shrivastava's user avatar
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 ...
sfdcfox's user avatar
  • 497k
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):...
Caspar Harmer's user avatar
8 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 ...
gNerb's user avatar
  • 9,510
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 ...
sfdcfox's user avatar
  • 497k
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.
sfdcfox's user avatar
  • 497k
7 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 ...
Mohith Shrivastava's user avatar
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 ...
Pmanglani's user avatar
  • 158
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: sf data create record --sobject TraceFlag -v "StartDate=$NOW ExpirationDate=$EXP TracedEntityId=$...
Freddy's user avatar
  • 202
6 votes
Accepted

Debug logs in developer console?

In the Developer Console, uncheck "Show My Current Logs Only".
Daniel Ballinger's user avatar
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:...
Jean Grey's user avatar
6 votes

Delete all in Debug log

Cross Posting as this question seems more canonical. You cannot delete the debug logs natively in Apex code. But you can use Rest DELETE endpoint to delete debug logs. I have created a utility code ...
Pranay Jaiswal's user avatar
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 ...
Kris Goncalves's user avatar
5 votes

Delete all in Debug log

In workbench, query for apex log using below query: SELECT Id FROM ApexLog Select view as: Bulk CSV Download the csv file Then in workbench go to Data tab -> select delete option select From file ...
Ramakrishna Madha's user avatar
5 votes
Accepted

Debug log - CPU Time limit issue

A while back, Salesforce made the CPU governor limit a little bit softer. If the demand on your pod (na3, cs14, eu1, etc...) is not particularly high at the time when you are executing some ...
Derek F's user avatar
  • 62.7k
5 votes
Accepted

why debug statement show Id instead of name while test class execution?

When debugging only the query results the relationships simply show the id. If you want the name you have to explicitly debug permissionset.name
Eric's user avatar
  • 54.2k
5 votes
Accepted

Avoid "Variable Assignment" log event creation

unfortunately without changing debug level VARIABLE_ASSIGNMENT event will be displayed at FINEST Apex code debug level. (according to Debug Log Levels) so, set debug level to FINER or less event ...
Oleksandr Berehovskyi's user avatar
5 votes
Accepted

VS Code + sfdx: debug logs

It sounds like you're hitting this bug: https://github.com/forcedotcom/salesforcedx-vscode/issues/1411 VS Code gets its error's from the cli and the cli has only been reporting errors on deploys ...
muchavie's user avatar
  • 492
5 votes

Enable Lightning Components "debug mode" for a guest user

You can set the UserPreferencesUserDebugModePref field on the Guest User to enable lightning component debug mode, e.g. $ sfdx force:data:record:update -s User -i 005... -v "...
xn.'s user avatar
  • 2,478
4 votes
Accepted

Customizing the Debug level

You can create your own Debug Levels by following these steps: Setup > Logs > Debug Level Click the New button Name your new Debug Level (Woohoo!) Select your level of Debug for each Category After ...
TSmith's user avatar
  • 5,052
4 votes

Automatically Remove System.debug statements from Apex Code?

Using sublime text you can use the feature Find > find in files (CTRL+Shift+F) Activate regular expression by clicking the button .* Search for System.debug(.*) and replace it with an empty ...
benahm's user avatar
  • 2,627

Only top scored, non community-wiki answers of a minimum length are eligible