improved fx/ingestor logging

This commit is contained in:
Stephan D
2025-12-12 01:07:03 +01:00
parent 2ca1a6956c
commit fd47867101
3 changed files with 28 additions and 12 deletions

View File

@@ -40,15 +40,15 @@ func main() {
application, err := app.New(logger, *configFile)
if err != nil {
logger.Fatal("Failed to initialise application", zap.Error(err))
}
if err := application.Run(ctx); err != nil {
if errors.Is(err, context.Canceled) {
logger.Info("FX ingestor stopped")
return
logger.Error("Failed to initialise application", zap.Error(err))
} else {
if err := application.Run(ctx); err != nil {
if errors.Is(err, context.Canceled) {
logger.Info("FX ingestor stopped")
return
}
logger.Error("Ingestor terminated with error", zap.Error(err))
}
logger.Fatal("Ingestor terminated with error", zap.Error(err))
}
logger.Info("FX ingestor stopped")