diff --git a/src/main/java/biz/paluch/logging/gelf/GelfMessageAssembler.java b/src/main/java/biz/paluch/logging/gelf/GelfMessageAssembler.java index 3955f6971..54df19ddd 100644 --- a/src/main/java/biz/paluch/logging/gelf/GelfMessageAssembler.java +++ b/src/main/java/biz/paluch/logging/gelf/GelfMessageAssembler.java @@ -197,7 +197,9 @@ private void setupStaticFields(PropertyProvider propertyProvider) { } public void addField(MessageField field) { - this.fields.add(field); + if (!fields.contains(field)) { + this.fields.add(field); + } } public void addFields(Collection fields) { diff --git a/src/main/java/biz/paluch/logging/gelf/wildfly/WildFlyJsonFormatter.java b/src/main/java/biz/paluch/logging/gelf/wildfly/WildFlyJsonFormatter.java index 0fdd1bc35..d05790a1e 100644 --- a/src/main/java/biz/paluch/logging/gelf/wildfly/WildFlyJsonFormatter.java +++ b/src/main/java/biz/paluch/logging/gelf/wildfly/WildFlyJsonFormatter.java @@ -21,6 +21,8 @@ import biz.paluch.logging.gelf.intern.GelfMessage; import biz.paluch.logging.gelf.jboss7.JBoss7JulLogEvent; +import java.util.*; + /** * Log-Formatter for JSON using fields specified within GELF. This formatter will produce a JSON object for each log event. * Example: @@ -46,6 +48,8 @@ * Following parameters are supported/needed: *