Skip to content

Commit

Permalink
even more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dmjb committed May 31, 2024
1 parent 1442dd3 commit 1b694cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/server/app/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// This file contains logic shared between different commands.

func wireUpDB(ctx context.Context, cfg *serverconfig.Config) (db.Store, func(), error) {
zerolog.Ctx(ctx).Info().
zerolog.Ctx(ctx).Debug().
Str("name", cfg.Database.Name).
Str("host", cfg.Database.Host).
Str("user", cfg.Database.User).
Expand Down
7 changes: 6 additions & 1 deletion cmd/server/app/encryption_rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ var rotateCmd = &cobra.Command{

ctx := logger.FromFlags(cfg.LoggingConfig).WithContext(context.Background())

zerolog.Ctx(ctx).Debug().
Str("default_key_id", cfg.Crypto.Default.KeyID).
Str("default_algorithm", string(crypto.DefaultAlgorithm)).
Msg("default encryption settings")

// instantiate `db.Store` so we can run queries
store, closer, err := wireUpDB(ctx, cfg)
if err != nil {
Expand Down Expand Up @@ -161,7 +166,7 @@ func runRotationBatch(
return 0, tokenError(token.ID, "secret retrieval", errors.New("no encrypted secret found"))
}

zerolog.Ctx(ctx).Info().
zerolog.Ctx(ctx).Debug().
Int32("token_id", token.ID).
Str("key_version", oldSecret.KeyVersion).
Str("algorithm", string(oldSecret.Algorithm)).
Expand Down

0 comments on commit 1b694cb

Please sign in to comment.