スキル一覧に戻る
bitsoex

structured-logging

by bitsoex

Bitso Java API Wrapper

34🍴 30📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: structured-logging description: > RFC-34 compliant structured logging standards for Java services. Covers JSON log format, structured arguments, required fields, and Logback configuration. Use when implementing or reviewing logging in Java services. compatibility: Java projects using Spring Boot with Logback metadata: version: "1.0.0" technology: java category: observability tags: - java - logging - rfc-34 - structured-logs - observability

Structured Logging

RFC-34 compliant structured logging standards for Java services.

When to use this skill

  • Implementing logging in new Java services
  • Converting unstructured logs to structured format
  • Reviewing logging practices
  • Configuring Logback for JSON output
  • Adding business context to logs

Skill Contents

Sections

Available Resources

📚 references/ - Detailed documentation


Quick Start

1. Add Dependencies

implementation 'org.springframework.boot:spring-boot-starter-logging'
implementation 'net.logstash.logback:logstash-logback-encoder:${latest_version}'

2. Use Structured Arguments

import static net.logstash.logback.argument.StructuredArguments.kv;

log.info("Transaction processed",
         kv("transaction_id", txn.getId()),
         kv("user_id", user.getId()));

This produces JSON with separate fields for transaction_id and user_id.

Required Fields

All logs must include these fields:

FieldDescription
@timestampLog timestamp
messageLog message text
loggerLogger name
thread_nameThread name
levelLog level (INFO, WARN, ERROR, etc.)
dd.serviceService name
dd.envEnvironment
dd.versionService version

Best Practices

  • Add business identifiers (IDs) as separate fields instead of embedding in messages
  • Keep log message text clear and concise
  • Use appropriate log levels consistently
  • Include enough context to understand the event without additional queries
  • Use snake_case for field names
  • For logs containing objects, properly structure them rather than using toString()

Example

// ✅ Good - structured fields
log.info("Order created", kv("order_id", orderId), kv("user_id", userId), kv("amount", amount));

// ❌ Bad - embedded in message
log.info("Order {} created for user {} with amount {}", orderId, userId, amount);

References

ReferenceDescription
references/logging-standards.mdComplete RFC-34 implementation guide
  • .cursor/rules/java-structured-logs.mdc - Full logging standards
SkillPurpose
java-standardsGeneral Java standards
java-testingTesting log output

スコア

総合スコア

65/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です