You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🏆 Hackathon Task: Implement Log Rotation in logger.go
🔹 Overview
The console project currently logs events using zerolog, but it does not support log rotation. We want to enhance our logging system by adding log rotation capabilities to prevent log files from growing indefinitely.
This task involves updating pkg/logger/logger.go to:
Enable log rotation using best practices.
Allow key rotation parameters to be configurable via environment variables.
Ensure backward compatibility with the existing logging structure.
🎯 Task Scope
Step 1: Update pkg/logger/logger.go to integrate log rotation.
Step 2: Use lumberjack.Logger (or an alternative) to handle file rotation.
Step 3: Ensure that rotation settings (e.g., max size, max backups, max age, compression) can be configured via environment variables.
Step 4: Implement sane defaults if environment variables are not set.
Step 5: Update the logger initialization to use a structured format for logs, maintaining compatibility with zerolog.
Step 6: Test the logging behavior by simulating log growth and verifying that rotation works as expected.
📂 Relevant Files
pkg/logger/logger.go
cmd/main.go (may need minor updates for initialization)
LOG_FILE_PATH=/var/log/amt-console.log
LOG_MAX_SIZE=10 # Max file size in MB before rotation
LOG_MAX_BACKUPS=5 # Max number of rotated log files
LOG_MAX_AGE=7 # Days to keep old logs
LOG_COMPRESS=true # Whether to compress rotated logs
The text was updated successfully, but these errors were encountered:
🏆 Hackathon Task: Implement Log Rotation in
logger.go
🔹 Overview
The
console
project currently logs events usingzerolog
, but it does not support log rotation. We want to enhance our logging system by adding log rotation capabilities to prevent log files from growing indefinitely.This task involves updating
pkg/logger/logger.go
to:🎯 Task Scope
pkg/logger/logger.go
to integrate log rotation.lumberjack.Logger
(or an alternative) to handle file rotation.zerolog
.📂 Relevant Files
pkg/logger/logger.go
cmd/main.go
(may need minor updates for initialization)config/config.go
(if adding environment variables)💻 Technical Details
zerolog
as the logging framework.lumberjack.Logger
(widely used and recommended)The text was updated successfully, but these errors were encountered: