Visionneuse de Logs

VérifiéPrudence

Consulter et rechercher les journaux des services de la plateforme de trading. Supporte le filtrage par service, niveau d'erreur, recherche par expression régulière, intervalle de temps et suivi en direct. Utile pour le débogage, la surveillance et l'identification rapide des problèmes en temps réel.

Spar Skills Guide Bot
DevOpsIntermédiaire
12002/06/2026
Claude Code
#logs#debugging#monitoring#kubernetes#docker

Recommandé pour

Notre avis

Affiche et filtre les logs des services d'une plateforme de trading, avec prise en charge de Docker Compose et Kubernetes.

Points forts

  • Filtrage avancé par service, niveau de log, expression régulière et erreurs uniquement.
  • Mode suivi en direct (--follow) pour observer les logs en continu.
  • Résumé des erreurs avec comptage et messages les plus récents.
  • Contexte autour des correspondances pour les recherches regex.

Limites

  • Nécessite que les services soient déployés avec Docker Compose ou Kubernetes.
  • Les motifs de logs reconnus sont spécifiques à une plateforme de trading.
  • La fonctionnalité avancée (stern, kubectl) dépend de l'infrastructure cible.
Quand l'utiliser

Utilisez cette compétence pour déboguer ou surveiller les logs d'une application en environnement de développement ou de staging.

Quand l'éviter

Ne l'utilisez pas pour des logs en production nécessitant une solution centralisée de gestion de logs (ELK, Splunk).

Analyse de sécurité

Prudence
Score qualité85/100

The skill is designed to access and filter logs via legitimate tools (docker, kubectl, stern). It does not instruct destructive actions, but the use of powerful shell commands with potentially unsanitized user input presents a moderate risk. The skill is inherently meant for debugging, but caution is warranted.

Points d'attention
  • Uses docker and kubectl commands with user-supplied arguments, which could allow command injection if the agent does not sanitize inputs (e.g., service name with shell metacharacters).
  • Log output may contain sensitive information (API keys, tokens, PII) depending on the logging practices of the services.

Exemples

Tail all service logs
Show me the last 50 lines of logs from all services.
Search for failure patterns
Search logs for 'order.*failed' and show matches with context lines.
Show only errors
Show me only error logs from the last 30 minutes across all services.

name: logs description: Tail and search service logs with filtering argument-hint: "[service|--search pattern|--errors]"

Log Viewer

Tail and search logs across trading platform services.

Usage

  • /logs - Tail all services (last 100 lines)
  • /logs api - Tail specific service
  • /logs --errors - Show only errors across all services
  • /logs --search "order.*failed" - Search with regex
  • /logs api --since 1h - Logs from last hour
  • /logs --level error - Filter by log level
  • /logs executor --follow - Live tail (follow mode)

Services

| Service | Container | Log Path | |---------|-----------|----------| | api | trading-api | stdout | | ui | trading-ui | stdout | | executor | trading-executor | stdout | | risk | trading-risk | stdout | | worker | trading-worker | stdout | | ml-server | ml-server | stdout | | market-ingest | market-ingest | stdout | | backtester | backtester | stdout |

Instructions

When this skill is invoked:

  1. Parse arguments:

    • Service name: Filter to specific service
    • --errors: Filter level=error or level=ERROR
    • --search <pattern>: Grep with regex pattern
    • --since <duration>: Time filter (1h, 30m, 1d)
    • --level <level>: Filter by log level
    • --follow / -f: Live tail mode
    • --lines N / -n N: Number of lines (default 100)
  2. For Docker Compose (dev):

    # Single service
    docker compose logs $SERVICE --tail $LINES $FOLLOW_FLAG
    
    # All services with grep
    docker compose logs --tail $LINES | grep -E "$PATTERN"
    
    # Errors only
    docker compose logs --tail 500 | grep -iE "error|exception|failed|traceback"
    
  3. For Kubernetes (staging/prod):

    # Single pod
    kubectl logs -l app=$SERVICE -n trading --tail=$LINES $FOLLOW_FLAG
    
    # With stern for multi-pod
    stern $SERVICE -n trading --since $SINCE
    
  4. Display formatted output:

    [09:31:05] api       INFO   Request: POST /orders
    [09:31:05] executor  INFO   Order received: abc123
    [09:31:06] executor  ERROR  Order failed: insufficient margin
    [09:31:06] risk      WARN   Margin utilization at 95%
    
  5. For --errors, highlight and summarize:

    ERROR SUMMARY (last 1h)
    ─────────────────────────────────────────────────────────
    executor    12 errors   "insufficient margin" (8), "timeout" (4)
    api         3 errors    "validation failed" (3)
    ml-server   1 error     "model not found" (1)
    
    Most recent errors:
    [09:31:06] executor  Order failed: insufficient margin for AAPL x100
    [09:30:45] executor  Connection timeout to broker
    
  6. For --search, show matches with context:

    • 2 lines before and after each match
    • Highlight matching text
    • Show total match count
  7. Common log patterns to recognize:

    • Order lifecycle: submitted → acknowledged → filled/rejected
    • Errors: exceptions, tracebacks, failed operations
    • Performance: slow queries, timeouts
    • Security: auth failures, rate limits
Skills similaires