示例#1
0
func Fluentd(config fluent.Config) *fluentdAppender {
	a := &fluentdAppender{
		layout:       layout.Default(),
		fluentConfig: config,
	}
	a.Open()
	return a
}
示例#2
0
文件: fluentd.go 项目: nereati/go-log
func SafeFluentd(config fluent.Config) (*fluentdAppender, error) {
	a := &fluentdAppender{
		layout:       layout.Default(),
		fluentConfig: config,
	}
	if err := a.Open(); err != nil {
		return nil, err
	}
	return a, nil
}
示例#3
0
func RollingFile(filename string, append bool) *rollingFileAppender {
	a := &rollingFileAppender{
		layout:         layout.Default(),
		MaxFileSize:    104857600,
		MaxBackupIndex: 1,
		append:         append,
		bytesWritten:   0,
	}
	err := a.SetFilename(filename)
	if err != nil {
		fmt.Printf("Error opening file: %s\n", err)
		return nil
	}
	return a
}
示例#4
0
func Console() *consoleAppender {
	a := &consoleAppender{
		layout: layout.Default(),
	}
	return a
}