This is driving me insane - I am no longer receiving full log files when running SFDX: Get Apex Debug Logs via VS Code's command palette. Instead, I get an empty file with the correct file name, but a single line - undefined. This makes debugging nearly impossible without having to resort to the dreaded developer console.

Steps to reproduce:

  1. Create project in VS Code w/SFDX extensions installed, and auth into an org
  2. Enable Apex Debug Logs (SFDX: Turn on Apex Debug Log for Replay Debugger in the command palette)
  3. Run something to capture, like a test class, or this anonymous script:
    Account a = new Account(Name = 'foo');
    insert a;
  4. Get Debug Logs (SFDX: Get Apex Debug Logs in the command palette)
  5. After the command runs, select the most recent log
  6. Expected: the log returns this:enter image description here
    Actual: the log file returns and looks like this: enter image description here

The log seems to be pasting to the Output panel as it normally would, so running simple anonymous scripts like the example above aren't so much of an issue. enter image description here However, this workaround does not help for more complex operations, like running/debugging apex test runs.

Similarly, running either of these commands directly in the CLI returns the correct log information, but it displays in the terminal window - and appears to be truncated because of the file size:
sfdx force:apex:log:get --logid {insertLogIdHere} --json --loglevel fatal
sfdx force:apex:log:get

I've tried this in multiple sandbox and dev orgs, along with creating new projects, exiting/force quit VS Code, and re-opening, and restarting my computer. Finally, I switched to my personal laptop and the issue no longer surfaces, so it seems to be tied to my specific instance of VS Code. I'm wondering if I accidentally messed up something in config files somewhere...

Does anyone have an idea of what might be causing this?

  • 2
    Have you tried SFDX: Authorize an Org (even if the org is authorized already)? Have you checked if the VS Code and SFDX are of same versions in both the PCs? Have you tried updating VS Code and SFDX CLI in the PC that is having this problem?
    – arut
    Sep 17, 2020 at 5:54
  • 1
    just tried re-authorizing, and no dice - same results as before. They are on different versions (my work PC is on Version 1.35.1), so I'll try updating and see if that works. Sep 17, 2020 at 14:54
  • 2
    Just finished installing, and it seems that resolved it. Thank you! Sep 17, 2020 at 16:17
  • 2
    OK. Its a good practice to keep them updated regularly.
    – arut
    Sep 17, 2020 at 17:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy