How to disable sampling #1212
-
On stackoverflow i see some references towards zap code on how to disable sampling. _logger = zap.New(core) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you're constructing a logger like that code sample -- with To enable sampling on top of that, you'd have to use zapcore.NewSamplerWithOptions. core = zapcore.NewSamplerWithOptions(...) But as-is, without any additional wrapping, sampling is already disabled. The other way you could've been constructing the logger is with |
Beta Was this translation helpful? Give feedback.
-
Nevermind :) |
Beta Was this translation helpful? Give feedback.
If you're constructing a logger like that code sample -- with
zapcore.NewCore
followed byzap.New
,sampling is already disabled.
To enable sampling on top of that, you'd have to use zapcore.NewSamplerWithOptions.
But as-is, without any additional wrapping, sampling is already disabled.
The other way you could've been constructing the logger is with
zap.Config
.Build()
,in which case, to disable sampling you'd have to set
Config.Sampling
to nil.