diff --git a/src/main/java/swg/entity/SwgConfiguration.java b/src/main/java/swg/entity/SwgConfiguration.java index dddc37e..71d9704 100644 --- a/src/main/java/swg/entity/SwgConfiguration.java +++ b/src/main/java/swg/entity/SwgConfiguration.java @@ -763,7 +763,7 @@ public class SwgConfiguration { public String toString() { StringBuilder output = new StringBuilder(type + ":" + path); - if(filters != null) { + if(filters != null && filters.size() > 0) { int filterSize = filters.size(); output.append("{"); for (int i = 0; i < filterSize; i++) { @@ -777,13 +777,14 @@ public class SwgConfiguration { public static class LogTargetFilter { private String type; - private String name; + private String match; + private boolean negate; private boolean filtered; LogTargetFilter() {} public String toString() { - return getTypeValue() + getFilteredValue() + name; + return getTypeValue() + getFilteredValue() + (isNegate() ? "!" : "") + match; } private String getTypeValue() { @@ -799,8 +800,10 @@ public class SwgConfiguration { } private String getFilteredValue() { - if(isFiltered()) return "-"; - return "+"; + if(isFiltered()) { + return isNegate() ? "+" : "-"; + } + return isNegate() ? "-" : "+"; } public String getType() { @@ -811,12 +814,20 @@ public class SwgConfiguration { this.type = type; } - public String getName() { - return name; + public String getMatch() { + return match; } - public void setName(String name) { - this.name = name; + public void setMatch(String match) { + this.match = match; + } + + public boolean isNegate() { + return negate; + } + + public void setNegate(boolean negate) { + this.negate = negate; } public boolean isFiltered() { diff --git a/src/main/resources/swg-defaults.yml b/src/main/resources/swg-defaults.yml index 2d4d3b6..f9e8208 100644 --- a/src/main/resources/swg-defaults.yml +++ b/src/main/resources/swg-defaults.yml @@ -139,16 +139,18 @@ sharedLog: logTargets: - type: net path: 127.0.0.1:44467 - filter: -# - type: file -# path: logs/log.txt -# filters: -# - type: channel -# name: profile -# filtered: true -# - type: channel -# name: CustomerService -# filtered: true + filters: + - type: file + path: logs/log.txt + filters: + - type: channel + match: profile + negate: true + filtered: true + - type: channel + match: CustomerService + negate: false + filtered: true sharedNetwork: oldestUnacknowledgedTimeout: 0 noDataTimeout: 1000000