go-zero/core/logx/syslog.go
2020-07-26 17:09:05 +08:00

16 lines
262 B
Go

package logx
import "log"
type redirector struct{}
// CollectSysLog redirects system log into logx info
func CollectSysLog() {
log.SetOutput(new(redirector))
}
func (r *redirector) Write(p []byte) (n int, err error) {
Info(string(p))
return len(p), nil
}