Based on the provided content, here are key points and best practices for logging in software systems:
Standard Log Shape
- Level: Each log entry should have a level (debug, info, warn, error, fatal).
- Timestamp: Use ISO 8601 format.
- Service: Identify which service emitted the log.
- Event: Use namespaced event identifiers (e.g.,
payment.webhook.received). - Request ID: Useful for tracing HTTP requests and queue-processor events.
- User ID: Include if the request is user-scoped.
- Tenant ID: For multi-tenant systems like Festease.
- Environment: Automatically injected by customProps on HTTP requests.
- Host: Automatically injected by customProps on HTTP requests.
- Duration: Time taken for an operation in milliseconds.
- Message: Human-readable summary of the log entry.
- Contextual Data: Domain-specific data like reference, amount, etc.
Best Practices
- Use Structured Logging:
- Use JSON format to ensure logs are machine-readable and easily parsed by tools like Logstash or
Read the full article at DEV Community
Want to create content about this topic? Use Nemati AI tools to generate articles, social posts, and more.

![[AINews] The Unreasonable Effectiveness of Closing the Loop](/_next/image?url=https%3A%2F%2Fmedia.nemati.ai%2Fmedia%2Fblog%2Fimages%2Farticles%2F600e22851bc7453b.webp&w=3840&q=75)



