diff --git a/agent/logs_agent.go b/agent/logs_agent.go index bf0ef29..7aff2d1 100644 --- a/agent/logs_agent.go +++ b/agent/logs_agent.go @@ -154,6 +154,12 @@ func (a *Agent) startLogAgent() { } endpoints, err := BuildEndpoints(intakeTrackType, AgentJSONIntakeProtocol, logsconfig.DefaultIntakeOrigin) + if err != nil { + message := fmt.Sprintf("Invalid endpoints: %v", err) + status.AddGlobalError("invalid endpoints", message) + log.Println("E!", errors.New(message)) + return + } processingRules, err := GlobalProcessingRules() if err != nil { message := fmt.Sprintf("Invalid processing rules: %v", err) diff --git a/main.go b/main.go index f1b72ef..137d1a6 100644 --- a/main.go +++ b/main.go @@ -100,6 +100,7 @@ EXIT: } } + ag.Stop() log.Println("I! exited") }