Skip to content

[LOGGING] Integrate Structured Logging Framework #79

@fentz26

Description

@fentz26

Problem

No structured logging framework:

  • Using fmt.Printf or log.Println
  • No log levels
  • Not queryable
  • No context propagation

Proposed Solution

zerolog Integration

import "github.com/rs/zerolog"

var log = zerolog.New(os.Stderr).With().Timestamp().Logger()

// Usage
log.Info().
    Str("task_id", task.ID).
    Str("status", task.Status).
    Dur("duration", elapsed).
    Msg("task completed")

// With context
ctx = log.With().Str("request_id", reqID).Logger().WithContext(ctx)
zerolog.Ctx(ctx).Info().Msg("processing request")

Log Levels

Level Usage
Trace Detailed debugging
Debug Development info
Info Normal operations
Warn Potential issues
Error Failures
Fatal Unrecoverable

Acceptance Criteria

  • zerolog or zap integrated
  • Structured JSON output
  • Log levels configurable
  • Request ID propagation
  • File and console output options
  • Log rotation

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions