Merge pull request #49 from kongfei605/fix_log_endpoints

fix building log endpoints without error judge
This commit is contained in:
kongfei605 2022-06-24 18:22:06 +08:00 committed by GitHub
commit 88263fdb62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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)

View File

@ -100,6 +100,7 @@ EXIT:
}
}
ag.Stop()
log.Println("I! exited")
}