@Test public void testEmail(){ String masked = mc.convert(getEvent("email=foo@bar.com")); assertEquals("email=foo*****", masked); masked = mc.convert(getEvent("email:foo@bar.com.sg")); assertEquals("email:foo*****", masked); masked = mc.convert(getEvent("\"email\":\"foo.baz@bar.com\"")); assertEquals("\"email\":\"foo.baz*****\"", masked); masked = mc.convert(getEvent("\"email\":\"foo@bar.com.sg\",signature=foo")); assertEquals("\"email\":\"foo*****\",signature=*****", masked); }
@Override public String convert(ILoggingEvent logEvent) { String message = logEvent.getMessage(); Set<Pattern> patternSet = patternMap.keySet(); if (message!=null && !message.equals("")) { for (Pattern pattern : patternSet) { message = pattern.matcher(message).replaceAll(patternMap.get(pattern)); } } return message; }
DefinedRegexMaskingConverter extends ClassicConverter { @Override public String convert(ILoggingEvent logEvent) { String message = logEvent.getMessage(); Set<Pattern> patternSet = patternMap.keySet(); if (message!=null && !message.equals("")) { for (Pattern pattern : patternSet) { message = pattern.matcher(message).replaceAll(patternMap.get(pattern)); } } return message; } }
DefinedRegexMaskingConverter extends ClassicConverter { @Override public String convert(ILoggingEvent logEvent) { String message = logEvent.getMessage(); Set<Pattern> patternSet = patternMap.keySet(); if (message!=null && !message.equals("")) { for (Pattern pattern : patternSet) { message = pattern.matcher(message).replaceAll(patternMap.get(pattern)); } } return message; }  }
DefinedRegexMaskingConverter extends ClassicConverter { @Override public String convert(ILoggingEvent logEvent) { String message = logEvent.getMessage(); Set<Pattern> patternSet = patternMap.keySet(); if (message!=null && !message.equals("")) { for (Pattern pattern : patternSet) { message = pattern.matcher(message).replaceAll(patternMap.get(pattern)); } } return message; }  @Override String convert(ILoggingEvent logEvent); @Override void start(); }
DefinedRegexMaskingConverter extends ClassicConverter { @Override public String convert(ILoggingEvent logEvent) { String message = logEvent.getMessage(); Set<Pattern> patternSet = patternMap.keySet(); if (message!=null && !message.equals("")) { for (Pattern pattern : patternSet) { message = pattern.matcher(message).replaceAll(patternMap.get(pattern)); } } return message; }  @Override String convert(ILoggingEvent logEvent); @Override void start();  }