Skip to content

Commit d048685

Browse files
authored
Enhance error logs for invalid custom fields (#235)
Add error logs when MaxMind databases fail to deserialize custom field
1 parent 10a55f7 commit d048685

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 7.3.2
2+
- Add logs when MaxMind databases fail to deserialize custom field [#235](https://github.com/logstash-plugins/logstash-filter-geoip/pull/235)
3+
14
## 7.3.1
25
- Avoid to crash pipelines when lookup a database with customised fields. [#225](https://github.com/logstash-plugins/logstash-filter-geoip/pull/225)
36

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.3.1
1+
7.3.2

src/main/java/org/logstash/filters/geoip/GeoIPFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class GeoIPFilter implements Closeable {
5353
// for more details https://github.com/logstash-plugins/logstash-filter-geoip/issues/226
5454
static class GeoIp2InvalidCustomFieldException extends GeoIp2Exception {
5555
public GeoIp2InvalidCustomFieldException(Throwable cause) {
56-
super("invalid custom field", cause);
56+
super("The database contains invalid custom field, which caused deserialization to fail.", cause);
5757
}
5858
}
5959

@@ -199,7 +199,7 @@ public boolean handleEvent(RubyEvent rubyEvent) {
199199
} catch (AddressNotFoundException e) {
200200
logger.debug("IP not found! exception={}, field={}, event={}", e, sourceField, event);
201201
} catch (GeoIp2Exception | IOException e) {
202-
logger.debug("GeoIP2 Exception. exception={}, field={}, event={}", e, sourceField, event);
202+
logger.error("Error from GeoIP database. field={}, value={}", sourceField, ip, e);
203203
}
204204

205205
return applyGeoData(geoData, event);

0 commit comments

Comments
 (0)