Writing a custom Log4j2 Appender and ThresholdFilter.