Skip to content

Instantly share code, notes, and snippets.

@sfdcale
Last active September 20, 2019 04:15
Show Gist options
  • Select an option

  • Save sfdcale/3be87db55c143ec6b55f74c8b2680f4b to your computer and use it in GitHub Desktop.

Select an option

Save sfdcale/3be87db55c143ec6b55f74c8b2680f4b to your computer and use it in GitHub Desktop.
This bash script is to download all log files from the environment.
#!/bin/bash
sfdx force:apex:log:list --targetusername=devsandbox --json | jq '.result[] | .Id' > apexlogids.csv
input="apexlogids.csv"
while IFS= read -r line
do
id="${line//\"/}"
echo "$id"
sfdx force:apex:log:get --logid="$id" --targetusername="devsandbox" > $id.log
done < "$input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment