Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 440 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 440 Bytes

SQLDB-LOGGER ZAP ADAPTER

stdout sample

zapCfg := zap.NewProductionConfig()
zapCfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel) // whatever minimum level
zapCfg.DisableCaller = true
logger, _ := zapCfg.Build()
// populate log pre-fields here before set to OpenDriver
db := sqldblogger.OpenDriver(
    dsn,
    &mysql.MySQLDriver{},
    zapadapter.New(logger),
    // optional config...
)