papertrail

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Papertrail

Papertrail

Query and download logs from Papertrail using
paperctl
.
使用
paperctl
从Papertrail查询并下载日志。

Prerequisites

前提条件

Requires
PAPERTRAIL_API_TOKEN
environment variable or
~/.config/paperctl/config.toml
.
需要配置
PAPERTRAIL_API_TOKEN
环境变量或
~/.config/paperctl/config.toml
配置文件。

Commands

命令

Pull logs from a system

从系统拉取日志

Download all logs for a system to
~/.cache/paperctl/logs/<system>.txt
:
bash
paperctl pull <system-name>
Partial name matching is supported. Use Taskcluster worker IDs directly:
bash
undefined
将某个系统的所有日志下载到
~/.cache/paperctl/logs/<system>.txt
bash
paperctl pull <system-name>
支持部分名称匹配。可直接使用Taskcluster工作节点ID:
bash
undefined

Matches vm-abc123def.reddog.microsoft.com

匹配vm-abc123def.reddog.microsoft.com

paperctl pull vm-abc123def

Pull with time range:

```bash
paperctl pull vm-abc123 --since -24h
paperctl pull vm-abc123 --since "2026-01-29T00:00:00" --until "2026-01-29T12:00:00"
Pull to specific location:
bash
paperctl pull vm-abc123 --output ~/logs/worker.txt
paperctl pull vm-abc123 --output ~/logs/  # Uses system name as filename
Pull multiple systems in parallel:
bash
paperctl pull vm-abc,vm-def,vm-ghi --output ~/logs/
paperctl pull vm-abc123def

按时间范围拉取:

```bash
paperctl pull vm-abc123 --since -24h
paperctl pull vm-abc123 --since "2026-01-29T00:00:00" --until "2026-01-29T12:00:00"
拉取到指定位置:
bash
paperctl pull vm-abc123 --output ~/logs/worker.txt
paperctl pull vm-abc123 --output ~/logs/  # 使用系统名称作为文件名
并行拉取多个系统的日志:
bash
paperctl pull vm-abc,vm-def,vm-ghi --output ~/logs/

Search logs

搜索日志

Search across all systems:
bash
paperctl search "error" --since -1h
paperctl search "error AND timeout" --since -24h --limit 100
Search specific system:
bash
paperctl search "error" --system vm-abc123 --since -1h
Save search results to file:
bash
paperctl search "error" --since -1h --file errors.txt
跨所有系统搜索:
bash
paperctl search "error" --since -1h
paperctl search "error AND timeout" --since -24h --limit 100
搜索特定系统:
bash
paperctl search "error" --system vm-abc123 --since -1h
将搜索结果保存到文件:
bash
paperctl search "error" --since -1h --file errors.txt

List systems

列出系统

bash
paperctl systems list
bash
paperctl systems list

Query syntax

查询语法

Papertrail search uses text matching with boolean operators. No regex or wildcards.
OperatorExample
AND
error AND timeout
OR
error OR warning
NOT
error NOT debug
Exact phrase
"connection refused"
Papertrail搜索支持带布尔运算符的文本匹配,不支持正则表达式或通配符。
运算符示例
AND
error AND timeout
OR
error OR warning
NOT
error NOT debug
精确短语
"connection refused"

Time formats

时间格式

FormatExample
Relative
-1h
,
-24h
,
-7d
,
2 hours ago
ISO timestamp
2026-01-29T00:00:00Z
Natural language
yesterday
,
last week
格式示例
相对时间
-1h
-24h
-7d
2 hours ago
ISO时间戳
2026-01-29T00:00:00Z
自然语言
yesterday
last week

Output formats

输出格式

Use
--format
to change output:
bash
paperctl pull vm-abc123 --format json
paperctl pull vm-abc123 --format csv
paperctl search "error" --output json
使用
--format
参数修改输出格式:
bash
paperctl pull vm-abc123 --format json
paperctl pull vm-abc123 --format csv
paperctl search "error" --output json

Common workflows

常见工作流

Download Taskcluster worker logs

下载Taskcluster工作节点日志

Get worker IDs from Taskcluster, then pull logs:
bash
undefined
从Taskcluster获取工作节点ID,然后拉取日志:
bash
undefined

Get recent workers from a pool

从节点池获取最近的工作节点

curl -s "https://firefox-ci-tc.services.mozilla.com/api/worker-manager/v1/workers/gecko-t%2Fwin11-64-24h2-alpha" |
jq -r '.workers | sort_by(.created) | reverse | .[0:3] | .[].workerId'
curl -s "https://firefox-ci-tc.services.mozilla.com/api/worker-manager/v1/workers/gecko-t%2Fwin11-64-24h2-alpha" |
jq -r '.workers | sort_by(.created) | reverse | .[0:3] | .[].workerId'

Pull logs using partial worker ID

使用部分工作节点ID拉取日志

paperctl pull vm-abc123def
undefined
paperctl pull vm-abc123def
undefined

Search for errors across workers

跨工作节点搜索错误

bash
paperctl search "error" --since -1h --file errors.txt
bash
paperctl search "error" --since -1h --file errors.txt

Investigate specific timeframe

排查特定时间段的问题

bash
paperctl pull vm-abc123 --since "2026-01-29T10:00:00" --until "2026-01-29T11:00:00" --output incident.txt
bash
paperctl pull vm-abc123 --since "2026-01-29T10:00:00" --until "2026-01-29T11:00:00" --output incident.txt