5

When using Visual Studio Code and Salesforce DX palette command:

SFDX Get Apex debug logs...

To get an Apex Log from the Salesforce servers, how can I then filter the output so I can only see the DEBUG statements? (like in the developer console).

2

You can run this in the VSCode terminal and the debug logs will be rendered there for you when you run your unit tests, etc.

sfdx force:apex:log:tail --color | grep --line-buffered "USER_DEBUG"
2

I think you can use Logpoints feature of debugger instead of USER_DEBUG (system.debug).

Reference:

1
  • Can someone verify this works?
    – Tyler Zika
    Sep 19 at 20:35
1

It's works for me (insert into cmd):

sfdx force:apex:execute -f "<myfilewithsystemdebug>" | grep --line-buffered "USER_DEBUG"

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.