vim-force.com icon indicating copy to clipboard operation
vim-force.com copied to clipboard

ApexLog always says no logs available

Open TyeBHarrison opened this issue 9 years ago • 3 comments

Any time I use ApexLog it says "No Log file available". vim-force.com is working. I can edit, ApexSave, ApexDeploy, and use ApexQuery with ApexScratch. I have debug logs turned on for my dev user account on Salesforce and can view new logs on Salesforce.com website/dev console.

TyeBHarrison avatar Jan 09 '15 22:01 TyeBHarrison

:ApexLog is just a shortcut to open a local log file previously generated by one of the commands which accepts log level before this command is executed. e.g. if you call :ApexExecuteAnonymous or :ApexTest and select a log type (other than None) then you get a log file open when command is completed (if completion was successful). If you close buffer with log file then you can then call :ApexLog to open log file again.

:ApexLog does not retrieve any existing debug logs from SFDC.

neowit avatar Jan 09 '15 22:01 neowit

Ah. Obviously, I completely misunderstood that from the docs.

In that case, since there is no API, is it within the spirit/scope of vim-force.com to use a query like: SELECT Id, SystemModStamp FROM ApexLog WHERE LogUserId = "<UserID>" Then use the returned Log Ids in a URL substitution to grab the raw log with Vim? I'm just trying to find ways to quickly get to the debug logs and avoid the dev console as much as possible.

TyeBHarrison avatar Jan 10 '15 00:01 TyeBHarrison

Main reason why real log retrieval has not been implemented is because I have not given it much thought in terms of usability and did not research API capabilities in this area.

On issue is that (as far as I understand) SFDC does not generate logs, unless explicitly requested to do so. In the example you mentioned - it is not a problem to download last log from SFDC - but unless you request that log to be generated in the first place, there will be no useful logs to look at.

If you have any ideas in terms of overall user flow and functionality in this area please share.

PS: turns out SFDC API actually does provide a REST resource to download a raw log file by Id.

neowit avatar Jan 10 '15 10:01 neowit