Skip to content

Commit

Permalink
Remove error trace from warning
Browse files Browse the repository at this point in the history
  • Loading branch information
czeumer committed Jun 10, 2023
1 parent 84d42a0 commit 152175a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ossec/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,11 @@ func (a *Client) writeMessage(msg string) error {
if err != nil || written == 0 {
AgentCollector.MessageError(a, 1)
if a.logger != nil {
a.logger.Warn("writeMessage", zap.Any("agentId", a.AgentID), zap.String("msg", msg), zap.Int("written", written), zap.Uint64("sentBytes", a.sentBytes), zap.Uint64("sentBytesTotal", a.sentBytesTotal), zap.Duration("rateWait", now.Sub(prev)), zap.Uint("globalCount", a.globalCount), zap.Uint("localCount", a.localCount), zap.Uint64("evtCount", a.evtCount), zap.Uint64("sentCount", a.sentCount), zap.Uint64("receivedCount", a.receivedCount), zap.Error(err))
a.logger.Warn("writeMessage", zap.Any("agentId", a.AgentID), zap.String("msg", msg), zap.Int("written", written), zap.Uint64("sentBytes", a.sentBytes), zap.Uint64("sentBytesTotal", a.sentBytesTotal), zap.Duration("rateWait", now.Sub(prev)), zap.Uint("globalCount", a.globalCount), zap.Uint("localCount", a.localCount), zap.Uint64("evtCount", a.evtCount), zap.Uint64("sentCount", a.sentCount), zap.Uint64("receivedCount", a.receivedCount), zap.String("error", err.Error()))
}
err2 := a.close(false)
if err2 != nil {
a.logger.Warn("closeFailed", zap.Any("agentId", a.AgentID), zap.Error(err2))
a.logger.Warn("closeFailed", zap.Any("agentId", a.AgentID), zap.String("error", err.Error()))
}
return err
}
Expand Down

0 comments on commit 152175a

Please sign in to comment.