agent: log error when agent crashes in an early stage (#7411)
This commit is contained in:
parent
40e632a955
commit
bc87976708
|
@ -221,6 +221,7 @@ func (c *cmd) run(args []string) int {
|
||||||
memSink, err := lib.InitTelemetry(config.Telemetry)
|
memSink, err := lib.InitTelemetry(config.Telemetry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.logger.Error(err.Error())
|
c.logger.Error(err.Error())
|
||||||
|
logGate.Flush()
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,6 +230,7 @@ func (c *cmd) run(args []string) int {
|
||||||
agent, err := agent.New(config, c.logger)
|
agent, err := agent.New(config, c.logger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.logger.Error("Error creating agent", "error", err)
|
c.logger.Error("Error creating agent", "error", err)
|
||||||
|
logGate.Flush()
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
agent.LogOutput = logOutput
|
agent.LogOutput = logOutput
|
||||||
|
|
Loading…
Reference in New Issue