templatize test logging level for logger setup and root logger

This commit is contained in:
Jonathan Shook 2022-12-20 23:11:55 -06:00
parent d6c9f5153d
commit 4f4b4982c8
10 changed files with 140 additions and 15 deletions

View File

@ -15,7 +15,7 @@
~ limitations under the License.
-->
<Configuration status="debug" strict="true" name="XMLConfigTest"
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
@ -48,7 +48,7 @@
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="trace">
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>

View File

@ -15,7 +15,7 @@
~ limitations under the License.
-->
<Configuration status="debug" strict="true" name="XMLConfigTest"
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
@ -48,7 +48,7 @@
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="trace">
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>

View File

@ -15,7 +15,7 @@
~ limitations under the License.
-->
<Configuration status="debug" strict="true" name="XMLConfigTest"
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
@ -48,7 +48,7 @@
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="trace">
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>

View File

@ -15,7 +15,7 @@
~ limitations under the License.
-->
<Configuration status="debug" strict="true" name="XMLConfigTest"
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="info"/>
@ -48,7 +48,7 @@
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="trace">
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>

View File

@ -23,6 +23,11 @@
<packaging>pom</packaging>
<properties>
<!-- Set this level to override the logging level for tests during build -->
<project.testlevel>INFO</project.testlevel>
<!-- Set this level to override the logging level for tests logging configuration during build -->
<project.test_logstatuslevel>INFO</project.test_logstatuslevel>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<javadoc.name>nosqlbench</javadoc.name>
@ -463,6 +468,12 @@
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -596,7 +607,7 @@
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.13</version>
<version>0.15</version>
<executions>
<execution>
<phase>verify</phase>

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022 nosqlbench
~
~ 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.
-->
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
<Appenders>
<Appender type="Console" name="STDOUT">
<Layout type="PatternLayout" pattern="%7r %-5level [%t] %-12logger{0} %msg%n%throwable"/>
<Filters>
<Filter type="MarkerFilter" marker="FLOW" onMatch="DENY" onMismatch="NEUTRAL"/>
<Filter type="MarkerFilter" marker="EXCEPTION" onMatch="DENY" onMismatch="ACCEPT"/>
</Filters>
</Appender>
<Appender type="Console" name="FLOW">
<Layout type="PatternLayout" pattern="%C{1}.%M %m %ex%n"/><!-- class and line number -->
<Filters>
<Filter type="MarkerFilter" marker="FLOW" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
<Filter type="MarkerFilter" marker="EXCEPTION" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</Appender>
<Appender type="File" name="APPSLOG" fileName="docs/apps.log">
<Layout type="PatternLayout">
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
</Layout>
</Appender>
</Appenders>
<Loggers>
<Logger name="io.nosqlbench.docsys" level="info" additivity="false">
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022 nosqlbench
~
~ 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.
-->
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
<Appenders>
<Appender type="Console" name="STDOUT">
<Layout type="PatternLayout" pattern="%7r %-5level [%t] %-12logger{0} %msg%n%throwable"/>
<Filters>
<Filter type="MarkerFilter" marker="FLOW" onMatch="DENY" onMismatch="NEUTRAL"/>
<Filter type="MarkerFilter" marker="EXCEPTION" onMatch="DENY" onMismatch="ACCEPT"/>
</Filters>
</Appender>
<Appender type="Console" name="FLOW">
<Layout type="PatternLayout" pattern="%C{1}.%M %m %ex%n"/><!-- class and line number -->
<Filters>
<Filter type="MarkerFilter" marker="FLOW" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
<Filter type="MarkerFilter" marker="EXCEPTION" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</Appender>
<Appender type="File" name="APPSLOG" fileName="docs/apps.log">
<Layout type="PatternLayout">
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
</Layout>
</Appender>
</Appenders>
<Loggers>
<Logger name="io.nosqlbench.docsys" level="info" additivity="false">
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>

View File

@ -15,7 +15,7 @@
~ limitations under the License.
-->
<Configuration status="debug" strict="true" name="XMLConfigTest"
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
@ -48,7 +48,7 @@
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="trace">
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>

View File

@ -15,7 +15,7 @@
~ limitations under the License.
-->
<Configuration status="debug" strict="true" name="XMLConfigTest"
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
@ -48,7 +48,7 @@
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="trace">
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>

View File

@ -15,7 +15,7 @@
~ limitations under the License.
-->
<Configuration status="debug" strict="true" name="XMLConfigTest"
<Configuration status="${project.test_logstatuslevel}" strict="true" name="XMLConfigTest"
packages="org.apache.logging.log4j.test">
<Filter type="ThresholdFilter" level="trace"/>
@ -48,7 +48,7 @@
<AppenderRef ref="APPSLOG"/>
</Logger>
<Root level="trace">
<Root level="${project.testlevel}">
<AppenderRef ref="STDOUT"/>
</Root>