Documentation
¶
Index ¶
- func Hex(k string, d []byte) zap.Field
- func InitLoggers(globalCfg GlobalConfig, subCfgs map[string]GlobalConfig, opts ...zap.Option) error
- func L() *zap.Logger
- func Logger(name string) *zap.Logger
- func RegisterLevelConfigMux(root *http.ServeMux)
- func S() *zap.SugaredLogger
- func T(ctx context.Context) otelzap.LoggerWithCtx
- type GlobalConfig
- type TraceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLoggers ¶
func InitLoggers(globalCfg GlobalConfig, subCfgs map[string]GlobalConfig, opts ...zap.Option) error
InitLoggers initializes the global logger and other sub loggers.
func RegisterLevelConfigMux ¶
RegisterLevelConfigMux registers log's level config http mux.
Types ¶
type GlobalConfig ¶
type GlobalConfig struct {
Zap *zap.Config `json:"zap" yaml:"zap"`
Trace *TraceConfig `json:"trace" yaml:"trace"`
StderrRedirectFile *string `json:"stderrRedirectFile" yaml:"stderrRedirectFile"`
RedirectStdLog bool `json:"stdLogRedirect" yaml:"stdLogRedirect"`
EcsIntegration bool `json:"ecsIntegration" yaml:"ecsIntegration"`
}
GlobalConfig defines the global logger configurations.
type TraceConfig ¶
type TraceConfig struct {
MinLevel string `json:"minLevel" yaml:"minLevel"`
ErrorStatusLevel string `json:"errorStatusLevel" yaml:"errorStatusLevel"`
Caller bool `json:"caller" yaml:"caller"`
CallerDepth int `json:"callerDepth" yaml:"callerDepth"`
StackTrace bool `json:"stackTrace" yaml:"stackTrace"`
WithTraceID bool `json:"withTraceID" yaml:"withTraceID"`
}
TraceConfig defines the logger configurations for tracing.
Click to show internal directories.
Click to hide internal directories.