SalesforceXyToolsCore/Python上でApexログを取得

The original page link

SalesforceXyToolsCore/Python上でApexログを取得

Topic

Apexログを取得

  • Salesforce組織のユーザ名、パスワード、Apiバージョン、Product/Sandboxを設定してください。
from SalesforceXytoolsCore import *
import pprint

config = {
    "api_version": 42.0, 
    "username": "sfdc username", 
    "password": "sfdc password", 
    "security_token": "", 
    "is_sandbox": True
}

tooling_api = ToolingApi(username=config["username"], 
                password=config["password"], 
                security_token=config["security_token"], 
                sandbox=config["is_sandbox"],
                version=config["api_version"]
                )

"""get apex log"""
log_id = '07LXXXXXXXXXXXXXXXXXXXX'
result = tooling_api.getLog(log_id)
pprint.pprint(result)