func Fluentd(config fluent.Config) *fluentdAppender { a := &fluentdAppender{ layout: layout.Default(), fluentConfig: config, } a.Open() return a }
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 }
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 }
func Console() *consoleAppender { a := &consoleAppender{ layout: layout.Default(), } return a }