Skip to content

Comments

docs(EM-49): Define Logging Standards and Structured Logging Configuration#62

Open
devin-ai-integration[bot] wants to merge 2 commits intofeat/microservices-migration-v2from
devin/1771610442-em49-logging-standards
Open

docs(EM-49): Define Logging Standards and Structured Logging Configuration#62
devin-ai-integration[bot] wants to merge 2 commits intofeat/microservices-migration-v2from
devin/1771610442-em49-logging-standards

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Feb 20, 2026

Summary

Adds logging standards documentation under docs/logging-standards/ and environment-specific Logback configuration templates under config/logback/. These complement (not duplicate) the existing docs/logging/README.md architecture overview and build on libs/ftgo-logging (EM-43) and libs/ftgo-tracing (EM-42).

Documentation (docs/logging-standards/):

  • README.md — index, quick start, integration diagram
  • log-levels.md — per-environment log level matrix (dev/staging/prod), level usage guidelines, anti-patterns, sensitive data rules
  • json-format.md — canonical JSON schema with required/optional fields, Elasticsearch field mapping
  • mdc-standards.md — standard and custom MDC fields, lifecycle management, async propagation patterns (TaskDecorator, CompletableFuture, Kafka)
  • log-aggregation.md — KQL query patterns, debugging workflows, Elasticsearch Query DSL examples, alerting thresholds

Logback Templates (config/logback/):

  • logback-spring-dev.xml — plain-text colored console, DEBUG root, verbose SQL/framework logging
  • logback-spring-staging.xml — JSON console + Logstash TCP, INFO root
  • logback-spring-prod.xml — JSON console + Logstash TCP, INFO root, conservative framework levels
  • logback-spring-test.xml — plain-text console, WARN root, no ftgo-logging dependency

No existing files modified. Documentation and config-template-only change.

Updates Since Last Revision

Addressed issues flagged in initial review:

  • Fixed stray ] character in json-format.md traceId example value
  • Removed unused SERVICE_NAME springProperty from dev, staging, and prod templates (the included logback-ftgo.xml fragment uses its own FTGO_SERVICE_NAME property)
  • Added clarifying callout in mdc-standards.md Kafka consumer section explaining why manually setting traceId is acceptable there (no HTTP request context for the tracing library to instrument)

Review & Testing Checklist for Human

  • Dev template activates on default profile: logback-spring-dev.xml uses <springProfile name="dev,local,default"> — this means DEBUG-level logging fires when no Spring profile is set. Confirm this is the desired team behavior or if default should be removed.
  • Logback templates are untested against a real service: No service currently wires these templates. Recommend copying one (e.g. dev) into a service and verifying it loads without errors before wider adoption.
  • Docs accuracy spot-check: The log level matrix, MDC field tables, and Kibana query examples are based on the existing libs/ftgo-logging and libs/ftgo-tracing code — worth a quick scan to confirm alignment with actual library behavior.

Suggested test plan:

  1. Copy config/logback/logback-spring-dev.xml to a service's src/main/resources/logback-spring.xml
  2. Run the service locally with spring.profiles.active=dev
  3. Verify console output includes colored plain-text logs with traceId/spanId/requestId MDC fields
  4. Repeat with the prod template and spring.profiles.active=prod to verify JSON output

Notes

Requested by: @abj453demo
Link to Devin run

…ation templates

- Create docs/logging-standards/ with comprehensive logging standards
- Define log level guidelines per environment (dev, staging, prod)
- Document MDC field standards and lifecycle management
- Define JSON log format schema with required/optional fields
- Document log aggregation patterns and Kibana search queries
- Create Logback configuration templates for dev, staging, prod, test
- Build on libs/ftgo-logging (EM-43) and libs/ftgo-tracing (EM-42)

Co-Authored-By: Alex Baker <alexandercommander453@gmail.com>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

- Fix stray ] in traceId example in json-format.md
- Remove unused SERVICE_NAME springProperty from dev/staging/prod templates
- Add clarifying note for Kafka consumer MDC exception to traceId rule

Co-Authored-By: Alex Baker <alexandercommander453@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants