Added Ping method to the logger class
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package fluentd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
@@ -36,6 +37,14 @@ func (l *Logger) Log(format string, v ...any) {
|
||||
}
|
||||
}
|
||||
|
||||
func (l *Logger) Ping() error {
|
||||
if l.fluent.RequestAck {
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.New("Logger service is unavailable")
|
||||
}
|
||||
|
||||
func (l *Logger) Close() error {
|
||||
return l.fluent.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user