forked from apache/calcite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CALCITE-4858] Use Log4j2 instead of unsupported Log4j (1.x) in tests
1. Replace slf4j-log4j12 dependency (using Log4j 1.x) with log4j-slf4j-impl (using Log4j 2.x) when possible. Cannot remove Log4j 1.x from Pig/Piglet modules due to compilation dependency of the latter directly to log4j. 2. Use XML syntax instead of property syntax for Log4j configuration. A Log4j configuration is hierarchical by nature so formats with natural support for nesting (such as XML) are easier to use. 3. Exclude slf4j-log4j12 when it comes transitively from other dependencies. It gets in conflict with log4j-slf4j-impl and it may also appear transitively in projects using Calcite. 4. Add log4j-slf4j-impl in modules (kafka, mongodb, plus, example) to silence error messages due to missing logger implementation. 5. Always use testRuntimeOnly annotation for dependencies on SLF4J logger implementation. Calcite shouldn't enforce a specific logger implementation so they should never appear as compile or runtime dependencies. A concrete implementation is only needed when we want to log messages for testing purposes. 6. Bump Cassandra version to 3.11.3 to use Log4j2 in tests. Previous versions did not allow the use of any custom logger implementation (only logback). This was resolved CASSANDRA-13396 so now we can use Log4j2 as the rest of the tests. 7. Unify display pattern in elasticsearch log4j2.xml with the rest of tests. 8. Add/Modify Log4j2 configuration (log4j2-test.xml) to silence errors and not display logging messages in tests. Instead of globally turning off logs, specific logger entries were set in the configuration files: (i) to avoid hiding by accident important problems; (ii) to faciliate switching log levels during debugging in the future. Close apache#2587
- Loading branch information
Showing
37 changed files
with
448 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to you 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> | ||
<Appenders> | ||
<Console name="A1" target="SYSTEM_OUT"> | ||
<PatternLayout | ||
pattern="%d [%t] %-5p - %m%n"/> | ||
</Console> | ||
</Appenders> | ||
|
||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="A1"/> | ||
</Root> | ||
<logger name="org.apache.cassandra" level="off"/> | ||
<logger name="com.datastax" level="WARN"/> | ||
<!-- Avoid showing connection errors on cassandra shutdown --> | ||
<logger name="com.datastax.driver.core.ControlConnection" level="off"/> | ||
</Loggers> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to you 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> | ||
<Appenders> | ||
<Console name="A1" target="SYSTEM_OUT"> | ||
<PatternLayout | ||
pattern="%d [%t] %-5p - %m%n"/> | ||
</Console> | ||
</Appenders> | ||
|
||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="A1"/> | ||
</Root> | ||
<!-- [CALCITE-2519] Silence ERROR logs from CalciteException, SqlValidatorException during tests --> | ||
<logger name="org.apache.calcite.runtime.CalciteException" level="FATAL"/> | ||
<logger name="org.apache.calcite.sql.validate.SqlValidatorException" level="ERROR"/> | ||
<logger name="org.apache.calcite.plan.RexImplicationChecker" level="FATAL"/> | ||
<logger name="org.apache.calcite.sql.test.SqlOperatorBaseTest" level="FATAL"/> | ||
<!-- [CALCITE-4858] Silence anything but errors --> | ||
<logger name="org.apache.calcite.plan.VisitorDataContext" level="ERROR"/> | ||
<logger name="org.apache.calcite.avatica" level="ERROR"/> | ||
<logger name="org.eclipse.jetty" level="ERROR"/> | ||
<logger name="org.apache.calcite.sql.parser" level="ERROR"/> | ||
</Loggers> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to you 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> | ||
<Appenders> | ||
<Console name="A1" target="SYSTEM_OUT"> | ||
<PatternLayout | ||
pattern="%d [%t] %-5p - %m%n"/> | ||
</Console> | ||
</Appenders> | ||
|
||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="A1"/> | ||
</Root> | ||
<logger name="org.apache.calcite.adapter.druid" level="ERROR"/> | ||
</Loggers> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to you 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> | ||
<Appenders> | ||
<Console name="A1" target="SYSTEM_OUT"> | ||
<PatternLayout | ||
pattern="%d [%t] %-5p - %m%n"/> | ||
</Console> | ||
</Appenders> | ||
|
||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="A1"/> | ||
</Root> | ||
<!-- Only report errors coming from Geode or its dependencies--> | ||
<logger name="org.apache.geode" level="ERROR"/> | ||
<logger name="org.eclipse.jetty" level="ERROR"/> | ||
<!-- Change level to INFO to see OQL queries --> | ||
<logger name="org.apache.calcite.adapter.geode" level="WARN"/> | ||
</Loggers> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.