Documentation ¶
Index ¶
- func NewBodyCore(batch logskd.LogProcessor, enab zapcore.LevelEnabler, opts ...Option) zapcore.Core
- func NewCore(enc zapcore.Encoder, batch logskd.LogProcessor, enab zapcore.LevelEnabler) zapcore.Core
- func NewSampler(core zapcore.Core, tick time.Duration, threshold, thereafter int, ...) zapcore.Core
- type Option
- type SamplerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBodyCore ¶
func NewBodyCore(batch logskd.LogProcessor, enab zapcore.LevelEnabler, opts ...Option) zapcore.Core
NewBodyCore creates a Core that writes logs to a WriteSyncer.
func NewCore ¶
func NewCore(enc zapcore.Encoder, batch logskd.LogProcessor, enab zapcore.LevelEnabler) zapcore.Core
NewCore creates a Core that writes logs to a WriteSyncer.
func NewSampler ¶ added in v2.3.4
func NewSampler( core zapcore.Core, tick time.Duration, threshold, thereafter int, options ...SamplerOption, ) zapcore.Core
NewSampler creates a Core that samples incoming entries, which caps the CPU and I/O load of logging while attempting to preserve a representative subset of your logs.
Zap samples by logging the first N entries with a given level and message each tick. If more Entries with the same level and message are seen during the same interval, every Mth message is logged and the rest are dropped.
Sampler can be configured to report sampling decisions with the SamplerHook option.
Keep in mind that zap's sampling implementation is optimized for speed over absolute precision; under load, each tick may be slightly over- or under-sampled.
Types ¶
type Option ¶ added in v2.3.0
type Option interface {
// contains filtered or unexported methods
}
func WithMaxMessageSize ¶ added in v2.3.0
func WithSyncInterval ¶ added in v2.3.0
type SamplerOption ¶ added in v2.3.4
type SamplerOption func(*sampler)
func WithSamplerLevelThreshold ¶ added in v2.3.4
func WithSamplerLevelThreshold(level zapcore.Level, n uint64) SamplerOption
func WithSamplerLevelThresholdString ¶ added in v2.3.4
func WithSamplerLevelThresholdString(str string) SamplerOption