diff options
Diffstat (limited to 'integrity-audit/src/test')
8 files changed, 55 insertions, 325 deletions
diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditCompareEntriesTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditCompareEntriesTest.java index 99cf4b2a..ad154d33 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditCompareEntriesTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditCompareEntriesTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Integrity Audit * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,12 +30,10 @@ import java.util.HashSet; import java.util.Map; import java.util.Properties; import java.util.Set; - import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.onap.policy.common.ia.jpa.IaTestEntity; import org.onap.policy.common.ia.jpa.IntegrityAuditEntity; @@ -419,7 +417,6 @@ public class DbAuditCompareEntriesTest extends IntegrityAuditTestBase { /* * Tests that comparison algorithm works for each entity in the database */ - @Ignore @Test public void testCompareAllDbEntities() throws Exception { logger.info("testCompareAllDbEntities: Entering"); diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java index 220b0635..c48ec0e3 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java @@ -2,7 +2,8 @@ * ============LICENSE_START======================================================= * Integrity Audit * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +25,12 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import com.google.re2j.Pattern; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.Persistence; import java.util.List; import java.util.Properties; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.Persistence; - import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -53,6 +53,7 @@ public class DbAuditTest extends IntegrityAuditTestBase { private static Logger logger = FlexLogger.getLogger(DbAuditTest.class); + private static final Pattern COMMA_PAT = Pattern.compile(","); private static final String RESOURCE_NAME = "pdp1"; private EntityManagerFactory emf2; @@ -240,7 +241,7 @@ public class DbAuditTest extends IntegrityAuditTestBase { assertFalse(dbglog.getExtracted().isEmpty()); String mismatchIndex = dbglog.getExtracted().get(dbglog.getExtracted().size() - 1); - int mismatchEntries = mismatchIndex.trim().split(",").length; + int mismatchEntries = COMMA_PAT.split(mismatchIndex.trim()).length; logger.info("mismatchTest: mismatchIndex found: '" + mismatchIndex + "'" + " mismatachEntries = " + mismatchEntries); diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbDaoTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbDaoTest.java index ef21e831..9f2103d7 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbDaoTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbDaoTest.java @@ -2,7 +2,8 @@ * ============LICENSE_START======================================================= * Integrity Audit * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,26 +26,18 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -/* - * All JUnits are designed to run in the local development environment - * where they have write privileges and can execute time-sensitive - * tasks. - */ - +import jakarta.persistence.PersistenceUnitUtil; +import jakarta.persistence.Query; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Root; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; - -import javax.persistence.PersistenceUnitUtil; -import javax.persistence.Query; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Root; - import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -65,7 +58,7 @@ public class DbDaoTest extends IntegrityAuditTestBase { private static final String SITE_B = "SiteB"; private static final String ENTITY_CLASS_NAME = "org.onap.policy.common.ia.jpa.IntegrityAuditEntity"; - private static String resourceName = "pdp0"; + private static final String resourceName = "pdp0"; private DbDao dbDao; diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DefaultLoggingPatternTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DefaultLoggingPatternTest.java index 959a4e7c..5944443e 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DefaultLoggingPatternTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/DefaultLoggingPatternTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +25,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.File; import java.io.IOException; - import org.junit.AfterClass; import org.junit.Test; import org.onap.policy.common.utils.resources.TextFileUtils; @@ -95,7 +95,7 @@ public class DefaultLoggingPatternTest { TextFileUtils.getTextFileAsString("testingLogs/common-modules/integrity-audit/logging-pattern-test.log") .substring(23); String expectedLoggedString = TextFileUtils - .getTextFileAsString("src/test/resources/" + loggerString + "-test.expectedlog").substring(23); + .getTextFileAsString("src/test/resources/" + loggerString + "-test.expectedlog").substring(23).trim(); assertThat(actualLoggedString).contains(expectedLoggedString); } diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTest.java index c9ff6854..9550017e 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Integrity Audit * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ package org.onap.policy.common.ia; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import java.util.Properties; - import org.junit.Test; public class IntegrityAuditTest { @@ -41,7 +41,7 @@ public class IntegrityAuditTest { StringBuilder badParams = new StringBuilder(); IntegrityAudit.parmsAreBad(null, SOMETHING, null, badParams); - assertFalse("".equals(badParams.toString())); + assertNotEquals("", badParams.toString()); assertTrue(badParams.toString().contains(RESOURCE_NAME)); assertTrue(badParams.toString().contains(PROPERTIES)); @@ -51,14 +51,14 @@ public class IntegrityAuditTest { props.put(IntegrityAuditProperties.DB_DRIVER, "test_db_driver"); IntegrityAudit.parmsAreBad(null, SOMETHING, props, badParams); - assertFalse("".equals(badParams.toString())); + assertNotEquals("", badParams.toString()); assertTrue(badParams.toString().contains(RESOURCE_NAME)); assertFalse(badParams.toString().contains(PROPERTIES)); // Try with 0 null params badParams = new StringBuilder(); IntegrityAudit.parmsAreBad("someting", SOMETHING, props, badParams); - assertFalse("".equals(badParams.toString())); + assertNotEquals("", badParams.toString()); assertFalse(badParams.toString().contains(RESOURCE_NAME)); assertFalse(badParams.toString().contains(PROPERTIES)); @@ -66,7 +66,7 @@ public class IntegrityAuditTest { props.put(IntegrityAuditProperties.NODE_TYPE, "bogus"); badParams = new StringBuilder(); IntegrityAudit.parmsAreBad("someting", SOMETHING, props, badParams); - assertFalse("".equals(badParams.toString())); + assertNotEquals("", badParams.toString()); assertTrue(badParams.toString().contains("nodeType")); } diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java index 1866bba0..f5a32777 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java @@ -2,7 +2,8 @@ * ============LICENSE_START======================================================= * Integrity Audit * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +26,10 @@ import static org.junit.Assert.fail; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.EntityTransaction; +import jakarta.persistence.Persistence; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; @@ -36,18 +41,14 @@ import java.util.Properties; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.EntityTransaction; -import javax.persistence.Persistence; import org.onap.policy.common.utils.jpa.EntityMgrCloser; import org.onap.policy.common.utils.jpa.EntityMgrFactoryCloser; import org.onap.policy.common.utils.jpa.EntityTransCloser; import org.onap.policy.common.utils.test.log.logback.ExtractAppender; import org.onap.policy.common.utils.time.CurrentTime; import org.onap.policy.common.utils.time.TestTime; -import org.powermock.reflect.Whitebox; import org.slf4j.LoggerFactory; +import org.springframework.test.util.ReflectionTestUtils; /** * All JUnits are designed to run in the local development environment where they have write @@ -177,6 +178,7 @@ public class IntegrityAuditTestBase { * @param dbUrl the URL to the DB * @throws IOException if an IO error occurs */ + @SuppressWarnings("unchecked") protected static void setUpBeforeClass(String dbUrl) throws IOException { // truncate the logs @@ -188,7 +190,7 @@ public class IntegrityAuditTestBase { IntegrityAuditTestBase.dbUrl = dbUrl; // save data that we have to restore at the end of the test - savedTime = Whitebox.getInternalState(AuditorTime.class, TIME_SUPPLY_FIELD); + savedTime = (Supplier<CurrentTime>) ReflectionTestUtils.getField(AuditorTime.class, TIME_SUPPLY_FIELD); savedDebugLevel = debugLogger.getLevel(); savedErrorLevel = errorLogger.getLevel(); @@ -208,7 +210,7 @@ public class IntegrityAuditTestBase { // done em = emf.createEntityManager(); - Whitebox.setInternalState(AuditorTime.class, TIME_SUPPLY_FIELD, timeSupplier); + ReflectionTestUtils.setField(AuditorTime.class, TIME_SUPPLY_FIELD, timeSupplier); debugLogger.setLevel(Level.DEBUG); errorLogger.setLevel(Level.ERROR); } @@ -220,7 +222,7 @@ public class IntegrityAuditTestBase { IntegrityAudit.setUnitTesting(false); - Whitebox.setInternalState(AuditorTime.class, TIME_SUPPLY_FIELD, savedTime); + ReflectionTestUtils.setField(AuditorTime.class, TIME_SUPPLY_FIELD, savedTime); debugLogger.setLevel(savedDebugLevel); errorLogger.setLevel(savedErrorLevel); @@ -243,7 +245,7 @@ public class IntegrityAuditTestBase { // Clean up the DB try (EntityTransCloser etc = new EntityTransCloser(em.getTransaction())) { - EntityTransaction et = etc.getTransation(); + EntityTransaction et = etc.getTransaction(); em.createQuery("Delete from IntegrityAuditEntity").executeUpdate(); @@ -290,7 +292,7 @@ public class IntegrityAuditTestBase { EntityTransCloser etc = new EntityTransCloser(emc.getManager().getTransaction())) { EntityManager entmgr = emc.getManager(); - EntityTransaction entrans = etc.getTransation(); + EntityTransaction entrans = etc.getTransaction(); // Clean up the DB entmgr.createQuery("Delete from " + tableName).executeUpdate(); @@ -304,8 +306,7 @@ public class IntegrityAuditTestBase { * Verifies that items appear within the log, in order. A given item may appear more than once. * In addition, the log may contain extra items; those are ignored. * - * @param textre regular expression used to extract an item from a line in the log. The first - * "capture" group of the regular expression is assumed to contain the extracted item + * @param app where data has been logged * @param items items that should be matched by the items extracted from the log, in order * @throws IOException if an IO error occurs * @throws AssertionError if the desired items were not all found diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/jpa/IaTestEntity.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/jpa/IaTestEntity.java index 4a4824c5..8a34909a 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/jpa/IaTestEntity.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/jpa/IaTestEntity.java @@ -2,7 +2,8 @@ * ============LICENSE_START======================================================= * Integrity Audit * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021, 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,26 +21,25 @@ package org.onap.policy.common.ia.jpa; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.PrePersist; +import jakarta.persistence.PreUpdate; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; import java.io.Serializable; import java.util.Date; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.PrePersist; -import javax.persistence.PreUpdate; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - @Entity @Table(name = "IaTestEntity") @NamedQueries({@NamedQuery(name = " IaTestEntity.findAll", query = "SELECT e FROM IaTestEntity e "), - @NamedQuery(name = "IaTestEntity.deleteAll", query = "DELETE FROM IaTestEntity WHERE 1=1")}) + @NamedQuery(name = "IaTestEntity.deleteAll", query = "DELETE FROM IaTestEntity WHERE 1=1")}) public class IaTestEntity implements Serializable { private static final long serialVersionUID = 1L; diff --git a/integrity-audit/src/test/resources/logback.xml b/integrity-audit/src/test/resources/logback.xml deleted file mode 100644 index 8f493cff..00000000 --- a/integrity-audit/src/test/resources/logback.xml +++ /dev/null @@ -1,262 +0,0 @@ -<!-- - ============LICENSE_START======================================================= - Integrity Audit - ================================================================================ - Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END========================================================= - --> - -<!-- Controls the output of logs for JUnit tests --> - -<configuration - scan="true" - scanPeriod="3 seconds" - debug="true"> - <!--<jmxConfigurator /> --> - <!-- directory path for all other type logs --> - <property - name="logDir" - value="testingLogs" /> - - <!-- directory path for debugging type logs --> - <property - name="debugDir" - value="testingLogs" /> - - <!-- specify the component name - <ONAP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC" --> - <property - name="componentName" - value="common-modules"></property> - <property - name="subComponentName" - value="integrity-audit"></property> - - <!-- log file names --> - <property - name="errorLogName" - value="error" /> - <property - name="metricsLogName" - value="metrics" /> - <property - name="auditLogName" - value="audit" /> - <property - name="debugLogName" - value="debug" /> - - <property - name="defaultPatternTimestamp" - value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX, UTC}" /> - - <property - name="defaultPatternTarget" - value="%X{requestId}|%X{serviceInstanceId}|%t|%X{serverName}|%X{serviceName}|%X{instanceUuid}" /> - - - <property - name="defaultPatternDetails" - value="%X{severity}|%X{serverIpAddress}|%X{server}|%X{clientIpAddress}" /> - - <property - name="defaultPattern" - value="${defaultPatternTimestamp}|${defaultPatternTarget}|%p|${defaultPatternDetails}|%c||%msg%n" /> - - <property - name="logDirectory" - value="${logDir}/${componentName}/${subComponentName}" /> - <property - name="debugLogDirectory" - value="${debugDir}/${componentName}/${subComponentName}" /> - <!-- - <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" /> - <property name="debugLogDirectory" value="${debugDir}/${componentName}/${subComponentName}" /> - --> - <!-- example from old log4j.properties: ${catalina.base}/logs/pdp-rest.log --> - <!-- Example evaluator filter applied against console appender --> - <appender - name="STDOUT" - class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>${defaultPattern}</pattern> - </encoder> - </appender> - - <!-- ============================================================================ --> - <!-- EELF Appenders --> - <!-- ============================================================================ --> - - <!-- The EELFAppender is used to record events to the general application - log --> - - - - - <!-- EELF Audit Appender. This appender is used to record audit engine - related logging events. The audit logger and appender are specializations - of the EELF application root logger and appender. This can be used to segregate - Policy engine events from other components, or it can be eliminated to record - these events as part of the application root log. --> - - <appender - name="EELFAudit" - class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${logDirectory}/${auditLogName}.log</file> - <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> - <fileNamePattern>${logDirectory}/${auditLogName}.%i.log.zip - </fileNamePattern> - <minIndex>1</minIndex> - <maxIndex>9</maxIndex> - </rollingPolicy> - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> - <maxFileSize>5MB</maxFileSize> - </triggeringPolicy> - <encoder> - <pattern>${defaultPattern}</pattern> - </encoder> - </appender> - <appender - name="asyncEELFAudit" - class="ch.qos.logback.classic.AsyncAppender"> - <queueSize>256</queueSize> - <appender-ref ref="EELFAudit" /> - </appender> - - <appender - name="EELFMetrics" - class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${logDirectory}/${metricsLogName}.log</file> - <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> - <fileNamePattern>${logDirectory}/${metricsLogName}.%i.log.zip - </fileNamePattern> - <minIndex>1</minIndex> - <maxIndex>9</maxIndex> - </rollingPolicy> - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> - <maxFileSize>5MB</maxFileSize> - </triggeringPolicy> - <encoder> - <pattern>${defaultPattern}</pattern> - </encoder> - </appender> - - - <appender - name="asyncEELFMetrics" - class="ch.qos.logback.classic.AsyncAppender"> - <queueSize>256</queueSize> - <appender-ref ref="EELFMetrics" /> - </appender> - - <appender - name="EELFError" - class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${logDirectory}/${errorLogName}.log</file> - <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> - <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip - </fileNamePattern> - <minIndex>1</minIndex> - <maxIndex>9</maxIndex> - </rollingPolicy> - <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>ERROR</level> - </filter> - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> - <maxFileSize>5MB</maxFileSize> - </triggeringPolicy> - <encoder> - <pattern>${defaultPattern}</pattern> - </encoder> - </appender> - - <appender - name="asyncEELFError" - class="ch.qos.logback.classic.AsyncAppender"> - <queueSize>256</queueSize> - <appender-ref ref="EELFError" /> - </appender> - - <appender - name="EELFDebug" - class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${debugLogDirectory}/${debugLogName}.log</file> - <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> - <fileNamePattern>${debugLogDirectory}/${debugLogName}.%i.log.zip - </fileNamePattern> - <minIndex>1</minIndex> - <maxIndex>9</maxIndex> - </rollingPolicy> - <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>DEBUG</level> - </filter> - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> - <maxFileSize>5MB</maxFileSize> - </triggeringPolicy> - <encoder> - <pattern>${defaultPattern}</pattern> - </encoder> - </appender> - - <appender - name="asyncEELFDebug" - class="ch.qos.logback.classic.AsyncAppender"> - <queueSize>256</queueSize> - <appender-ref ref="EELFDebug" /> - <includeCallerData>true</includeCallerData> - </appender> - - - <!-- ============================================================================ --> - <!-- EELF loggers --> - <!-- ============================================================================ --> - - <logger - name="com.att.eelf.audit" - level="info" - additivity="false"> - <appender-ref ref="asyncEELFAudit" /> - </logger> - - <logger - name="com.att.eelf.metrics" - level="info" - additivity="false"> - <appender-ref ref="asyncEELFMetrics" /> - </logger> - - <logger - name="com.att.eelf.error" - level="error" - additivity="false"> - <appender-ref ref="asyncEELFError" /> - </logger> - - <!-- <logger name="com.att.eelf.debug" level="info" additivity="false"> --> - <logger - name="com.att.eelf.debug" - level="debug" - additivity="false"> - <appender-ref ref="asyncEELFDebug" /> - </logger> - - - <!-- <root level="INFO"> --> - <root level="DEBUG"> - <appender-ref ref="asyncEELFDebug" /> - <appender-ref ref="asyncEELFError" /> - </root> - -</configuration> |