initial import
This commit is contained in:
15
core/logx/syslog.go
Normal file
15
core/logx/syslog.go
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user