-
-
Save prakharxagrawal/6c58968339fecc300cb92ffce3da7540 to your computer and use it in GitHub Desktop.
Download all debug logs from a Salesforce org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is a script by Thomas Gagné posted here: | |
# https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8irTSAR | |
# but modified to use the `sfdx` CLI tool instead | |
# of the `force` CLI tool. | |
# This assumes the user is logged in and the default | |
# org is set. If you're running this outside of a | |
# Salesforce DX project folder, just add the username | |
# (to specify which org to run this against) to both | |
# sfdx commands with `-u your.username@whatever.com` | |
# Original comments below: | |
# script for export ALL debug logs to a subdirectory | |
# named "log". | |
# | |
# it requires the "force" CLI tool be available and | |
# assumes the user is already logged in. | |
# | |
# Sure, I could have added more debugging, like checking | |
# to see if the user was logged in, but I didn't have | |
# all night. ;-) | |
# | |
# 2017-08-29 tggagne@gmail.com | |
for logId in $(sfdx force:data:soql:query -q "select id from apexlog" | tail -n +3); do | |
echo "writing log/$logId.debug" | |
sfdx force:apex:log:get --logid $logId > log/$logId.debug | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment