Compare commits

..

1 Commits

Author SHA1 Message Date
e16021ee49 Added Ping method to the logger class 2025-10-12 19:17:17 +02:00

View File

@@ -1,7 +1,6 @@
package fluentd
import (
"errors"
"fmt"
"log"
@@ -38,11 +37,15 @@ func (l *Logger) Log(format string, v ...any) {
}
func (l *Logger) Ping() error {
if l.fluent.RequestAck {
return nil
mapData := map[string]string{
"message": "Checking is Fluentd alive",
}
err := l.fluent.Post(l.appName, mapData)
if err != nil {
return err
}
return errors.New("Logger service is unavailable")
return nil
}
func (l *Logger) Close() error {