Versions in this module Expand all Collapse all v1 v1.0.0 Jul 18, 2021 Changes in this version + const AtomicLevelAddrEnvKey + const LogFilename + const SentryDSNEnvKey + const SentryDebugEnvKey + var AtomicLevelMap = map[string]zap.AtomicLevel + var EncoderConfig = zapcore.EncoderConfig + var GormLoggerCallerSkip = 3 + var GormLoggerName = "gorm" + var ZapcoreLevelMap = map[string]zapcore.Level + func AttachCore(l *zap.Logger, c zapcore.Core) *zap.Logger + func CallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder) + func CloneLogger(name string, fields ...zap.Field) *zap.Logger + func CtxLogger(c context.Context, fields ...zap.Field) *zap.Logger + func CtxTraceID(c context.Context) string + func Debug(c context.Context, msg string, fields ...zap.Field) + func Debugf(c context.Context, template string, args ...interface{}) + func Debugs(c context.Context, args ...interface{}) + func Debugw(c context.Context, msg string, keysAndValues ...interface{}) + func Error(c context.Context, msg string, fields ...zap.Field) + func Errorf(c context.Context, template string, args ...interface{}) + func Errors(c context.Context, args ...interface{}) + func Errorw(c context.Context, msg string, keysAndValues ...interface{}) + func ExtraField(keysAndValues ...interface{}) zap.Field + func Fatal(c context.Context, msg string, fields ...zap.Field) + func Fatalf(c context.Context, template string, args ...interface{}) + func Fatals(c context.Context, args ...interface{}) + func Fatalw(c context.Context, msg string, keysAndValues ...interface{}) + func FuncName(pc uintptr) string + func GetGinRequestBody(c *gin.Context) []byte + func GetGinTraceIDFromHeader(c *gin.Context) string + func GetGinTraceIDFromPostForm(c *gin.Context) string + func GetGinTraceIDFromQueryString(c *gin.Context) string + func GinLogger() gin.HandlerFunc + func GinLoggerWithConfig(conf GinLoggerConfig) gin.HandlerFunc + func Info(c context.Context, msg string, fields ...zap.Field) + func Infof(c context.Context, template string, args ...interface{}) + func Infos(c context.Context, args ...interface{}) + func Infow(c context.Context, msg string, keysAndValues ...interface{}) + func NewCtxLogger(c context.Context, logger *zap.Logger, traceID string) (context.Context, *zap.Logger) + func NewLogger(options Options) (*zap.Logger, error) + func NewSentryClient(dsn string, debug bool) (*sentry.Client, error) + func NewSentryCore(cfg SentryCoreConfig, sentryClient *sentry.Client) zapcore.Core + func Panic(c context.Context, msg string, fields ...zap.Field) + func Panicf(c context.Context, template string, args ...interface{}) + func Panics(c context.Context, args ...interface{}) + func Panicw(c context.Context, msg string, keysAndValues ...interface{}) + func RegisterLumberjackSink(sink *LumberjackSink) error + func ReplaceLogger(newLogger *zap.Logger) func() + func SentryAttach(l *zap.Logger, sentryClient *sentry.Client) *zap.Logger + func SentryCaptureException(err error) error + func SentryCaptureMessage(msg string) error + func SentryClient() *sentry.Client + func ServerIP() string + func SetLevel(lvl string) + func TextLevel() string + func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) + func Warn(c context.Context, msg string, fields ...zap.Field) + func Warnf(c context.Context, template string, args ...interface{}) + func Warns(c context.Context, args ...interface{}) + func Warnw(c context.Context, msg string, keysAndValues ...interface{}) + type AtomicLevelServerOption struct + Addr string + Password string + Path string + Username string + type Ctxkey string + var CtxLoggerName Ctxkey = "ctx_logger" + var TraceIDKeyname Ctxkey = "trace_id" + var TraceIDPrefix = "logging_" + type GinLogDetails struct + BodySize int + ClientIP string + ContentLength int + ContentType string + ContextKeys map[string]interface{} + HandlerName string + Host string + Latency float64 + Method string + Path string + Proto string + Query string + Referer string + RemoteAddr string + RequestBody interface{} + RequestForm url.Values + RequestHeader http.Header + RequestURI string + ResponseBody interface{} + StatusCode int + Timestamp time.Time + UserAgent string + type GinLoggerConfig struct + EnableContextKeys bool + EnableDetails bool + EnableRequestBody bool + EnableRequestForm bool + EnableRequestHeader bool + EnableResponseBody bool + Formatter func(context.Context, GinLogDetails) string + InitFieldsFunc func(context.Context) map[string]interface{} + SkipPathRegexps []string + SkipPaths []string + SlowThreshold time.Duration + TraceIDFunc func(context.Context) string + type GormLogger struct + func NewGormLogger(logLevel zapcore.Level, traceWithLevel zapcore.Level, ...) GormLogger + func (g GormLogger) CtxLogger(ctx context.Context) *zap.Logger + func (g GormLogger) Error(ctx context.Context, msg string, data ...interface{}) + func (g GormLogger) Info(ctx context.Context, msg string, data ...interface{}) + func (g GormLogger) LogMode(gormLogLevel gormlogger.LogLevel) gormlogger.Interface + func (g GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) + func (g GormLogger) Warn(ctx context.Context, msg string, data ...interface{}) + type LumberjackSink struct + Scheme string + func NewLumberjackSink(scheme, filename string, maxAge, maxBackups, maxSize int, ...) *LumberjackSink + func (LumberjackSink) Sync() error + type Options struct + AtomicLevelServer AtomicLevelServerOption + DisableCaller bool + DisableStacktrace bool + EncoderConfig *zapcore.EncoderConfig + Format string + InitialFields map[string]interface{} + Level string + LumberjackSink *LumberjackSink + Name string + OutputPaths []string + SentryClient *sentry.Client + type SentryCoreConfig struct + DisableStacktrace bool + FlushTimeout time.Duration + Hub *sentry.Hub + Level zapcore.Level + Tags map[string]string