Skip to content

Commit

Permalink
Merge pull request #831 from kakao/fix_logger_options
Browse files Browse the repository at this point in the history
fix(logger): no overriding custom zap logger options
  • Loading branch information
ijsong authored Aug 13, 2024
2 parents cf671cd + ed416fe commit 17b6dd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/util/log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package log

import (
"os"
"slices"
"time"

"go.uber.org/zap"
Expand Down Expand Up @@ -54,10 +55,10 @@ func New(opts ...Option) (*zap.Logger, error) {
core := zapcore.NewCore(encoder, syncer, level)

// Recommended zap.Option
zapOpts := append(cfg.zapOpts,
zapOpts := slices.Concat([]zap.Option{
zap.AddCaller(),
zap.AddStacktrace(zap.ErrorLevel),
)
}, cfg.zapOpts)

// Sampler
if cfg.zapSampling != nil {
Expand Down

0 comments on commit 17b6dd9

Please sign in to comment.