0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Salesforce Inspector を使用したデバッグログの一括削除

Last updated at Posted at 2025-05-22

概要

デバッグログを一括削除する方法はいくつかありますが、Chrome 拡張機能の Salesforce Inspector Reloaded を使用した方法が楽だったので記事にしました。

Salesforce inspector は Chrome 拡張機能のベストプラクティスに沿っていないため使用できなくなりました。Salesforce inspector の後継となる Salesforce Inspector Reloaded を使用してください。

手順

  1. 画面右端の出っ張りをクリックして Inspector の画面を開き、「Data Export」をクリック

    image.png

  2. 「Tooling API?」にチェックを付けて「Export Query」欄に削除したいデバッグログ(ApexLog オブジェクト)を抽出する SOQL を入力し、「Run Export」ボタンをクリック

    image.png

    私がよく使う SOQL を添付します。

    • 全てのデバッグログを取得
      SELECT Id, StartTime, Status, LogUserId, Operation, DurationMilliseconds, LogLength, Application, Location, Request, RequestIdentifier FROM ApexLog ORDER BY StartTime DESC
      
    • 今日より前のデバッグログを取得
      SELECT Id, StartTime, Status, LogUserId, Operation, DurationMilliseconds, LogLength, Application, Location, Request, RequestIdentifier FROM ApexLog WHERE StartTime < TODAY ORDER BY StartTime DESC
      
    • 指定した開始時刻より前のデバッグログを取得(2000-01-01T00:00:00+0900 の部分を任意の日時に置き換えてください)
      SELECT Id, StartTime, Status, LogUserId, Operation, DurationMilliseconds, LogLength, Application, Location, Request, RequestIdentifier FROM ApexLog WHERE StartTime < 2000-01-01T00:00:00+0900 ORDER BY StartTime DESC
      

    :

  3. 「Copy (CSV)」ボタンをクリック

  4. 画面右端の出っ張りをクリックして Inspector の画面を開き、「Data Import」をクリック

    image.png

  5. 「Configure Import」欄に以下の内容を入力

    項目
    API Type Tooling
    Action Delete
    Object ApexLog
    Format CSV
    Data 先ほどコピーしたCSVを貼り付け
  6. 「Skip all unknown fields」ボタンをクリックして Id 項目のみマッピングし、「Run Delete」ボタンをクリック→確認画面が表示されるので「Delete」をクリック

    image.png

  7. 全て「Succeeded」になれば削除完了

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?