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:
- Create project in VS Code w/SFDX extensions installed, and auth into an org
- Enable Apex Debug Logs (SFDX: Turn on Apex Debug Log for Replay Debugger in the command palette)
- Run something to capture, like a test class, or this anonymous script:
Account a = new Account(Name = 'foo');
insert a;
- Get Debug Logs (SFDX: Get Apex Debug Logs in the command palette)
- After the command runs, select the most recent log
- Expected: the log returns this:
Actual: the log file returns and looks like this:
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.
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?
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?