Skip to content

Commit

Permalink
file logger fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Dec 17, 2024
1 parent fb3e86f commit 964a871
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/file_logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ package main
import (
"github.com/getevo/evo/v2/lib/log"
"github.com/getevo/evo/v2/lib/log/file" // Replace with the correct import path
"time"
)

func main() {
// Add the file logger with custom configuration
log.AddWriter(file.NewFileLogger(file.Config{
Path: "./logs", // Directory to store logs
FileName: "app_%y-%m-%d.log", // Filename template with wildcards
Expiration: 7, // Keep logs for 7 days
Expiration: 7*time.Day, // Keep logs for 7 days
LogFormat: nil, // Use default log format
}))

Expand Down

0 comments on commit 964a871

Please sign in to comment.