Skip to main content

Logging Overview

Bifrost’s logging system provides:
  • Flexible log levels (DEBUG, INFO, WARN, ERROR, FATAL)
  • Custom logger interfaces for integration with your logging system
  • Request/response tracing with correlation IDs
  • Performance metrics and timing information
  • Provider-specific logging for debugging integrations

Basic Logger Implementation

Standard Library Logger

Use Go’s standard library logger:

Advanced Logger Implementations

JSON Structured Logger

Create structured JSON logs for production systems:

Logrus Integration

Integrate with the popular Logrus logging library:

Request Tracing and Correlation

Request Correlation Logger

Track requests with correlation IDs:

Performance and Metrics Logging

Performance Monitoring Logger

Log detailed performance metrics:

Environment-Specific Logging

Development vs Production Logging

Configure different logging for different environments:

Multiple Output Destinations

Log to multiple destinations simultaneously:

Security and Sanitization

Secure Logger

Sanitize sensitive information from logs:

Testing Logging

Mock Logger for Testing

Create a mock logger for unit tests:
Architecture: For logging system design and best practices, see Architecture Documentation.