Token导航 LogoToken导航

Agent Skill · 研究检索

railway-logs(铁路日志)

railway-logs 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

railway-logs 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 57,063。

总安装 441周安装 18GitHub Stars 9下载 143核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:railway-logs(铁路日志)
来源仓库:https://github.com/adaptationio/skrillz
仓库路径:skills/railway-logs
安装命令:
npx skills add https://github.com/adaptationio/skrillz --skill railway-logs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/adaptationio/skrillz --skill railway-logs

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

railway-logs 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。

安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。它属于研究检索类工具,适用于多种宿主环境。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/railway-logs

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/adaptationio/skrillz --skill railway-logs;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

railway-logs 怎么安装?

在终端执行 npx skills add https://github.com/adaptationio/skrillz --skill railway-logs。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

railway-logs 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

railway-logs 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

railway-logs 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

railway-logs 用的人多吗?

公开数据是累计安装 441 次,近一周安装 18 次,下载 143 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

railway-logs 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
railway-logs

铁路日志 · 本页

4419接触敏感数据MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Railway Logs

Access and analyze Railway logs for debugging and monitoring applications.

Overview

Railway provides comprehensive logging across the deployment lifecycle:

  • Build Logs: Build process output and compilation
  • Deploy Logs: Deployment lifecycle and health checks
  • Runtime Logs: Application stdout/stderr output
  • HTTP Logs: Request metadata (status, path, IP, timing)

All logs support filtering, search, and can be exported to external systems for long-term retention.

Keywords: Railway logs, build logs, deploy logs, runtime logs, HTTP logs, log filtering, log search, debugging, monitoring, observability

When to Use This Skill

  • Debugging deployment failures
  • Investigating runtime errors
  • Monitoring application behavior
  • Analyzing HTTP request patterns
  • Filtering logs for specific events
  • Exporting logs to external systems (Datadog, Axiom, BetterStack)
  • Understanding build/deploy process
  • Troubleshooting performance issues

Prerequisites: Link Project First

Important: CLI logs require a linked project with Account Token:

# 1. Set Account Token (NOT project token)
export RAILWAY_API_TOKEN=<your-account-token>

# 2. Link project/environment/service
railway link -p <PROJECT_ID> -e <ENVIRONMENT_ID> -s <SERVICE_ID>

# Example:
railway link -p f8fff4f1-1541-4a47-b509-0c30b9459275 \
             -e 3aa108f4-781d-433c-9eee-875c3dbe903d \
             -s 4b879f5f-5e42-4804-a67c-2a1ff2475cb3

# 3. Verify link
railway status

See cli-commands.md for complete reference.


Operations

Operation 1: View Build Logs

Access build process logs to debug compilation and dependency issues.

CLI Commands:

# Stream build logs (live)
railway logs --build

# Last 100 lines of build logs
railway logs --build --lines 100

# Build logs for specific deployment
railway logs --build <DEPLOYMENT_ID>

# Export build logs to file
railway logs --build --lines 500 > build-logs.txt

Dashboard Access:

  1. Navigate to Railway Dashboard → Your Service
  2. Click Deployments tab
  3. Select deployment
  4. View Build Logs section

What to Look For:

  • ✅ Dependency installation success
  • ✅ Build steps completion
  • ⚠️ Warning messages (may indicate future issues)
  • ❌ Build failures and error messages
  • 📊 Build time (optimization opportunities)

Common Issues:

IssueSolution
Dependencies not installingCheck package.json/requirements.txt
Build timeoutOptimize build process or increase timeout
Missing build commandSet in Railway dashboard or railway.json
Cache issuesForce rebuild without cache

See Also: railway-troubleshooting for cache busting


Operation 2: View Deploy Logs

Monitor deployment lifecycle and health check status.

CLI Commands:

# Stream deployment logs (live)
railway logs --deployment

# Last N lines of deploy logs
railway logs --deployment --lines 200

# Specific deployment by ID
railway logs --deployment <DEPLOYMENT_ID>

# Export deploy logs
railway logs --deployment --lines 500 > deploy-logs.txt

Dashboard Access:

  1. Railway Dashboard → Service → Deployments
  2. Select deployment
  3. View Deploy Logs section

Deployment Phases:

  1. Building - Compiling code
  2. Publishing - Creating container image
  3. Deploying - Rolling out to infrastructure
  4. Health Checking - Verifying service health
  5. Active - Deployment live

Health Check Debugging:

# View health check failures
railway logs --deployment | grep "health check"

# Common health check issues:
# - Port not exposed correctly
# - Application not binding to 0.0.0.0
# - Health endpoint not responding
# - Application crashing during startup

Troubleshooting:

  • Health check failing? Verify PORT environment variable
  • Deployment stuck? Check for blocking startup processes
  • Rollback occurring? Check health check configuration

Operation 3: View Runtime Logs

Access application stdout/stderr for debugging runtime behavior.

CLI Commands:

# Stream runtime logs (live, Ctrl+C to stop)
railway logs

# Last N lines (stops streaming)
railway logs --lines 500

# Stream different service/environment
railway logs --service backend --environment production

# Filter with Railway syntax
railway logs --filter "@level:error"
railway logs --lines 100 --filter "timeout"

# Pipe to grep for local filtering
railway logs | grep ERROR

# JSON output for parsing
railway logs --json | jq 'select(.level == "error")'

Dashboard Access:

  1. Railway Dashboard → Service → Observability
  2. Click Logs tab
  3. Real-time log stream with filtering

Structured Logging Best Practices:

Railway supports structured JSON logging. Output JSON on a single line:

// Node.js Example
console.log(JSON.stringify({
  level: 'error',
  message: 'Database connection failed',
  error: err.message,
  timestamp: new Date().toISOString(),
  userId: req.user?.id
}));
# Python Example
import json
import logging

logging.basicConfig(format='%(message)s')
logger = logging.getLogger()

logger.error(json.dumps({
    'level': 'error',
    'message': 'Database connection failed',
    'error': str(e),
    'timestamp': datetime.utcnow().isoformat(),
    'user_id': user_id
}))

Supported Log Levels:

  • debug - Detailed diagnostic information
  • info - General informational messages
  • warn - Warning messages (potential issues)
  • error - Error messages (failures)

Benefits:

  • All JSON fields are searchable in Railway dashboard
  • Better filtering and analysis
  • Integration with log aggregation tools

Operation 4: View HTTP Logs

Analyze HTTP request patterns and debug API issues.

Dashboard Access:

  1. Railway Dashboard → Service → Observability
  2. Click HTTP tab
  3. View request metadata

Available Metadata:

  • HTTP method (GET, POST, etc.)
  • Request path
  • Status code
  • Response time (ms)
  • Client IP address
  • User agent
  • Timestamp

Filtering HTTP Logs:

# Filter by status code
@httpStatus:500

# Filter by path
@path:"/api/users"

# Combine filters
@httpStatus:500 AND @path:"/api"

Use Cases:

  • Identify slow endpoints (high response time)
  • Find error patterns (500, 404 status codes)
  • Analyze traffic patterns
  • Debug API issues
  • Monitor rate limits

Performance Analysis:

# Find slow requests (>1000ms)
# Filter in dashboard: responseTime > 1000

# Find all 5xx errors
# Filter: @httpStatus:5xx

# Analyze specific endpoint
# Filter: @path:"/api/checkout"

Operation 5: Filter and Search Logs

Use Railway's powerful filtering syntax for targeted log analysis.

Filter Syntax:

FilterExampleDescription
Substring"error"Search for text
HTTP Status@httpStatus:500Filter by status code
Service ID@service:<id>Filter by service
Log Level@level:errorFilter by severity
Custom Field@userId:123Filter by JSON field

Boolean Operators:

# AND - Both conditions must match
@httpStatus:500 AND @path:"/api"

# OR - Either condition matches
@level:error OR @level:warn

# NOT - Exclude matches
NOT @path:"/health"

# Grouping
(@level:error OR @level:warn) AND @service:api

Common Filter Patterns:

# All errors from last hour
@level:error

# Slow HTTP requests (>1000ms)
@httpStatus:200 AND responseTime > 1000

# Failed API calls
@path:"/api" AND @httpStatus:5xx

# Exclude health checks
NOT @path:"/health" NOT @path:"/metrics"

# Specific user errors
@level:error AND @userId:12345

# Database connection issues
"connection refused" OR "timeout"

Dashboard Filtering:

  1. Observability → Logs
  2. Enter filter in search box
  3. Use dropdowns for common filters
  4. Save frequent filters as presets

CLI Filtering:

# Use grep for basic filtering (streaming is default)
railway logs | grep ERROR

# Use jq for JSON logs
railway logs --json | jq 'select(.level == "error")'

# Complex filtering with awk
railway logs | awk '/ERROR/ || /WARN/'

Operation 6: Export Logs Externally

Export logs to external systems for long-term retention and analysis.

Why Export?

  • Railway retention: 7-30 days (plan dependent)
  • Long-term log storage
  • Advanced analytics
  • Compliance requirements
  • Centralized multi-service logging

External Export Options:

Option 1: Locomotive Sidecar (Webhook Export)

Deploy a sidecar container to forward logs via webhooks.

Repository: https://github.com/railwayapp/locomotive

Setup:

# Add locomotive service to Railway project
railway service create locomotive

# Configure environment variables
WEBHOOK_URL=https://your-log-endpoint.com/ingest
WEBHOOK_METHOD=POST
WEBHOOK_HEADERS='{"Authorization": "Bearer xxx"}'

# Deploy locomotive
railway up

Supported Destinations:

  • Custom webhooks
  • Datadog
  • Axiom
  • BetterStack
  • Logtail
  • Any HTTP endpoint
Option 2: OpenTelemetry (OTEL) Integration

Send logs using OTEL protocol.

Environment Variables:

# Add to your service
OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector.example.com:4318
OTEL_EXPORTER_OTLP_HEADERS=x-api-key=xxx
OTEL_SERVICE_NAME=my-railway-service

Supported OTEL Collectors:

  • Grafana Alloy
  • OpenTelemetry Collector
  • Datadog Agent
  • New Relic
  • Honeycomb

See Also: observability-stack-setup for LGTM stack

Option 3: Log Streaming Script

Use the provided script to stream logs to external systems.

Usage:

# Stream to file
.claude/skills/railway-logs/scripts/stream-logs.sh --output file --path logs/

# Stream to webhook
.claude/skills/railway-logs/scripts/stream-logs.sh --output webhook \
  --url https://logs.example.com/ingest \
  --token YOUR_API_KEY

# Stream to S3
.claude/skills/railway-logs/scripts/stream-logs.sh --output s3 \
  --bucket my-logs-bucket \
  --prefix railway/

Features:

  • Continuous streaming
  • Automatic reconnection
  • Buffering and batching
  • Multiple output formats
Option 4: Manual Export

Export logs for ad-hoc analysis.

# Export last 1000 lines
railway logs --lines 1000 > logs-$(date +%Y%m%d-%H%M%S).txt

# Export recent logs (specify number of lines)
railway logs --lines 1000 > logs-recent.txt

# Export and compress
railway logs --lines 5000 | gzip > logs.txt.gz

Scheduled Export (cron):

# Add to crontab (every 6 hours)
0 */6 * * * railway logs --lines 10000 > /backup/railway-logs-$(date +\%Y\%m\%d-\%H\%M).txt

Integration with External Tools

Datadog

# Install Datadog agent in Railway
# Add environment variables:
DD_API_KEY=xxx
DD_SITE=datadoghq.com
DD_LOGS_ENABLED=true
DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true

Axiom

# Use locomotive sidecar
WEBHOOK_URL=https://api.axiom.co/v1/datasets/<dataset>/ingest
WEBHOOK_HEADERS='{"Authorization": "Bearer <token>"}'

BetterStack (Logtail)

# Add to your application
LOGTAIL_SOURCE_TOKEN=xxx

# Use Logtail SDK
npm install @logtail/node

Grafana Loki

# Deploy Grafana Agent/Alloy
# Configure to scrape Railway logs
# See observability-stack-setup skill

Best Practices

1. Structured Logging

DO:

console.log(JSON.stringify({ level: 'info', message: 'User login', userId: 123 }));

DON'T:

console.log(`User ${userId} logged in`); // Hard to search/filter

2. Log Levels

Use appropriate severity:

  • debug - Development/troubleshooting only
  • info - Normal operations
  • warn - Potential issues (high memory, slow queries)
  • error - Failures requiring attention

3. Sensitive Data

NEVER log:

  • Passwords
  • API keys
  • Credit card numbers
  • Personal identifiable information (PII)

Redact sensitive data:

console.log(JSON.stringify({
  level: 'info',
  message: 'User login',
  email: 'u***@example.com', // Redacted
  ip: req.ip
}));

4. Performance

Avoid excessive logging:

// BAD - Logs every request
app.use((req, res, next) => {
  console.log(`Request: ${req.method} ${req.path}`);
  next();
});

// GOOD - Log only errors or important events
app.use((req, res, next) => {
  if (res.statusCode >= 400) {
    console.log(JSON.stringify({ level: 'error', method: req.method, path: req.path, status: res.statusCode }));
  }
  next();
});

5. External Export

For production:

  • Export logs to external system (Railway retention is limited)
  • Use structured logging (JSON)
  • Implement log rotation
  • Set up alerts on error patterns

Troubleshooting Common Issues

IssueSolution
Logs not appearingCheck application is writing to stdout/stderr
JSON logs not parsingEnsure JSON is on single line (no newlines)
Logs truncatedRailway may truncate very long log lines (>10KB)
Missing logsCheck log retention period for your plan
Can't filter by custom fieldVerify field is in structured JSON log
High log volumeReduce logging verbosity, sample logs

Quick Reference

TaskCommand
Stream runtime logsrailway logs
Last N linesrailway logs --lines 100
Build logsrailway logs --build
Deploy logsrailway logs --deployment
Export to filerailway logs --lines 500 > output.txt
Filter errors`railway logs \grep ERROR`
JSON filtering`railway logs --json \jq 'select(.level == "error")'`

Important: CLI vs API

Use CLI for logs, not API. The Railway GraphQL API log queries (deploymentLogs, buildLogs) often return "Problem processing request". The CLI provides reliable log access:

railway logs                    # Runtime logs
railway logs --deployment       # Build/deploy logs
railway logs --lines 100        # Historical logs

See railway-api/references/api-limitations.md for details.


Related Skills


References

See the references/ directory for detailed guides:

Scripts

See the scripts/ directory for automation tools:


Last Updated: 2025-11-26

平台分布

Claude Code

28.84%
按下载量换算41

OpenCode

25.38%
按下载量换算36

github-copilot

17.2%
按下载量换算25

Codex

14.85%
按下载量换算21

Gemini CLI

8.27%
按下载量换算12

Cursor

3.95%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills