Skip to content

Instantly share code, notes, and snippets.

@cmsong-shina
cmsong-shina / logger.go
Last active July 5, 2021 08:49 — forked from rnyrnyrny/logger.go
log using uber zap and lumberjack
// 2021.7.2 UPDATE
// According to zap's doc, now we can use zapcore.AddSync to directly add lumberjack as a zap sync
// see https://github.com/uber-go/zap/blob/master/FAQ.md#does-zap-support-log-rotation
// thanks to:
// https://studygolang.com/articles/17394
// https://stackoverflow.com/questions/54395407/zap-logging-with-1-customized-config-and-2-lumberjack
package logger
import (