From e2aefda183de4f1c1256d97f7ce09f8bee5477db Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Tue, 9 May 2017 14:24:20 -0400 Subject: [ONAP-rebase] Rebase as 1.1.0-SNAPSHOT Consolidate into a single maven project; no more separate model and client jars. Change-Id: Ibbba982250b74c0dfd09ee1c65c0fb6c158dd632 Signed-off-by: Christopher Lott Signed-off-by: Christopher Lott (cl778h) --- .../fusionapp/util/CustomLoggingFilter.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 dcae_dmaapbc_webapp/dbca-common/src/main/java/org/openecomp/fusionapp/util/CustomLoggingFilter.java (limited to 'dcae_dmaapbc_webapp/dbca-common/src/main/java/org/openecomp/fusionapp/util/CustomLoggingFilter.java') diff --git a/dcae_dmaapbc_webapp/dbca-common/src/main/java/org/openecomp/fusionapp/util/CustomLoggingFilter.java b/dcae_dmaapbc_webapp/dbca-common/src/main/java/org/openecomp/fusionapp/util/CustomLoggingFilter.java new file mode 100644 index 0000000..4562584 --- /dev/null +++ b/dcae_dmaapbc_webapp/dbca-common/src/main/java/org/openecomp/fusionapp/util/CustomLoggingFilter.java @@ -0,0 +1,37 @@ +package org.openecomp.fusionapp.util; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.filter.Filter; +import ch.qos.logback.core.spi.FilterReply; + +/** + * Custom Filter class bind with logback.xml configuration file to strip out + * certain log messages coming out of special packages or classes. + * + */ +public class CustomLoggingFilter extends Filter { + + /** + * Custom Filter is added to strip out the continuous U-EB logging messages + * But make sure we log the ERROR and WARNING Level messages. + * + * @param event + * Logging event + */ + @Override + public FilterReply decide(ILoggingEvent event) { + try { + if ((event.getLevel() != Level.ERROR || event.getLevel() != Level.WARN) + && (event.getThreadName().equalsIgnoreCase("UEBConsumerThread")) + && (event.getLoggerName().contains("com.att.nsa") + || event.getLoggerName().contains("org.apache.http"))) { + return FilterReply.DENY; + } else { + return FilterReply.NEUTRAL; + } + } catch (Exception e) { + return FilterReply.NEUTRAL; + } + } +} -- cgit 1.2.3-korg