Skip to content

Commit

Permalink
add log rotation to docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmasek committed Feb 15, 2025
1 parent 64820f0 commit 3d351c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ var debugCmd = &cobra.Command{
Short: "Development tools, use with caution",
RunE: func(cmd *cobra.Command, args []string) error {
logger := logging.Get()
logger.Debugw("Debug message", "foo", 42)
logger.Infow("Info message", "foo", 42)
logger.Warnw("Warn message", "foo", 42)
logger.Errorw("Error message", zap.Error(fmt.Errorf("big bad")))
repeat, err := cmd.Flags().GetInt("repeat")
if err != nil {
return err
}
for range repeat {
logger.Debugw("Debug message", "foo", 42)
logger.Infow("Info message", "foo", 42)
logger.Warnw("Warn message", "foo", 42)
logger.Errorw("Error message", zap.Error(fmt.Errorf("big bad")))
}
cmd.Println("Done")
return nil
},
}

func init() {
debugCmd.Flags().Int("repeat", 1, "")

rootCmd.AddCommand(debugCmd)
}
5 changes: 5 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ services:
environment:
# Allow insecure TLS if username is "beacon". Remove this in production.
- BEACON_EMAIL_TLS_INSECURE=beacon
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"

# SMTP server for development and testing.
# For production configure your SMTP inside the Beacon config file instead.
Expand Down

0 comments on commit 3d351c9

Please sign in to comment.