Skip to content

Commit 9d8aaa3

Browse files
changed request parser logging to not log at error level (#122)
1 parent 712d89b commit 9d8aaa3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
- Changed logging for requestParser to log INFO or WARNING instead of ERROR
9+
on failures to create the record [#122](https://github.com/xmidt-org/svalinn/pull/122)
810

911
## [v0.13.0]
1012
- Updated release pipeline to use travis [#117](https://github.com/xmidt-org/svalinn/pull/117)

requestParser/requestParser.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,12 @@ func (r *RequestParser) parseRequest(request wrp.Message) {
181181
record, reason, err := r.createRecord(request, rule, eventType)
182182
if err != nil {
183183
r.measures.DroppedEventsCount.With(reasonLabel, reason).Add(1.0)
184-
logging.Error(r.logger, emperror.Context(err)...).Log(logging.MessageKey(),
184+
if reason == blackListReason {
185+
logging.Info(r.logger, emperror.Context(err)...).Log(logging.MessageKey(),
186+
"Failed to create record", logging.ErrorKey(), err.Error())
187+
return
188+
}
189+
logging.Warn(r.logger, emperror.Context(err)...).Log(logging.MessageKey(),
185190
"Failed to create record", logging.ErrorKey(), err.Error())
186191
return
187192
}

0 commit comments

Comments
 (0)