-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-4441] Log4j2 configuration fixes and removal of log4j1 dependencies #6170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 44 commits
185a60e
956a4b0
ac9ea80
2a317eb
8669088
c7f4397
7f37493
d3c9266
a0f4695
2d1028e
a3cc6e4
b0de1cd
79c02b0
1a2d20c
dbac26f
34485e3
16ff6fb
c7481b6
6bb9f9a
111dd8b
943826e
95500ad
1de7212
e3a54b8
9b3abc2
69f96ea
9439176
a329180
644e763
e9a0d90
b2d6b01
ab07f13
53c4195
a71b8d7
2b94083
fe71d7f
c272a3a
e1e4c74
5963b23
4b92656
90e2512
625d6c7
ea168c8
555cc3c
7330577
1b5f474
520b1b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| ### | ||
| # 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. | ||
| ### | ||
| status = warn | ||
| name = HudiConsoleLog | ||
|
|
||
| # Set everything to be logged to the console | ||
| appender.console.type = Console | ||
| appender.console.name = CONSOLE | ||
| appender.console.layout.type = PatternLayout | ||
| appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n | ||
|
|
||
| # Root logger level | ||
| rootLogger.level = warn | ||
| # Root logger referring to console appender | ||
| rootLogger.appenderRef.stdout.ref = CONSOLE | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to specify stderr or would it fallback to stdout when not set?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it will fallback to stdout |
||
|
|
||
| # Set the default spark-shell log level to WARN. When running the spark-shell, the | ||
| # log level for this class is used to overwrite the root logger's log level, so that | ||
| # the user can have different defaults for the shell and regular Spark apps. | ||
| logger.apache_spark_repl.name = org.apache.spark.repl.Main | ||
| logger.apache_spark_repl.level = warn | ||
| # Set logging of integration testsuite to INFO level | ||
| logger.hudi_integ.name = org.apache.hudi.integ.testsuite | ||
| logger.hudi_integ.level = info | ||
| # Settings to quiet third party logs that are too verbose | ||
| logger.apache_spark_jetty.name = org.spark_project.jetty | ||
| logger.apache_spark_jetty.level = warn | ||
| logger.apache_spark_jett_lifecycle.name = org.spark_project.jetty.util.component.AbstractLifeCycle | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it really odd that we need to now come up with the name for this loggers, instead of just identifying them by the package-name
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I'm not a fan of using the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this about allowing users to fine-tune the logging level for different loggers? i felt in Hudi we don't have to maintain these. users should just override for the loggers they need.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is allows for fine grain control over the logging for the sake of the demo. Should we leave this one instance in the repo since it's for a docker demo?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. |
||
| logger.apache_spark_jett_lifecycle.level = error | ||
| logger.apache_spark_repl_imain.name = org.apache.spark.repl.SparkIMain$exprTyper | ||
| logger.apache_spark_repl_imain.level = info | ||
| logger.apache_spark_repl_iloop.name = org.apache.spark.repl.SparkILoop$SparkILoopInterpreter | ||
| logger.apache_spark_repl_iloop.level = info | ||
| logger.parquet.name = org.apache.parquet | ||
| logger.parquet.level = error | ||
| logger.spark.name = org.apache.spark | ||
| logger.spark.level = warn | ||
| # Disabling Jetty logs | ||
| logger.jetty.name = org.apache.hudi.org.eclipse.jetty | ||
| logger.jetty.level = error | ||
| # SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support | ||
| logger.hive_handler.name = org.apache.hadoop.hive.metastore.RetryingHMSHandler | ||
| logger.hive_handler.level = fatal | ||
| logger.hive_func_registry.name = org.apache.hadoop.hive.ql.exec.FunctionRegistry | ||
| logger.hive_func_registry.level = error | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,28 +207,20 @@ | |
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-core</artifactId> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-1.2-api</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-api</artifactId> | ||
| <scope>test</scope> | ||
| <groupId>org.slf4j</groupId> | ||
|
||
| <artifactId>jul-to-slf4j</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-slf4j-impl</artifactId> | ||
| <scope>test</scope> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not package any logging dependencies (should be provided along w/ query engine)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the cli package used exclusively with query engines? I can imagine it being used as a standalone package as well
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used as standalone |
||
| </dependency> | ||
|
|
||
| <dependency> | ||
|
|
@@ -330,6 +322,12 @@ | |
| </dependency> | ||
|
|
||
| <!-- Test --> | ||
| <dependency> | ||
| <groupId>org.apache.hudi</groupId> | ||
| <artifactId>hudi-tests-common</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,10 +58,6 @@ | |
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-api</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-core</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-1.2-api</artifactId> | ||
|
|
@@ -193,6 +189,12 @@ | |
| </dependency> | ||
|
|
||
| <!-- Test --> | ||
| <dependency> | ||
| <groupId>org.apache.hudi</groupId> | ||
| <artifactId>hudi-tests-common</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should extract these deps as well to "hudi-tests-common". while we're at it
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know why junit-vintage-engine is being used by any chance? Do we still need to support running junit4 tests in some modules? I can add in the junit-jupiter-api, junit-jupiter-engine to the common test module
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. We can try to remove it and see what happens.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still an exception in |
||
| <artifactId>junit-jupiter-api</artifactId> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ | |
| import org.mockito.junit.jupiter.MockitoExtension; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.UUID; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
@@ -68,17 +69,24 @@ public class TestCallbackHttpClient { | |
| @Mock | ||
| StatusLine statusLine; | ||
|
|
||
| private Level initialLogLevel; | ||
|
|
||
| @BeforeEach | ||
| void prepareAppender() { | ||
| when(appender.getName()).thenReturn("MockAppender"); | ||
| when(appender.getName()).thenReturn("MockAppender-" + UUID.randomUUID()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch! |
||
| when(appender.isStarted()).thenReturn(true); | ||
| when(appender.isStopped()).thenReturn(false); | ||
| ((Logger) LogManager.getLogger(HoodieWriteCommitHttpCallbackClient.class)).addAppender(appender); | ||
| Logger logger = (Logger) LogManager.getLogger(HoodieWriteCommitHttpCallbackClient.class); | ||
| initialLogLevel = logger.getLevel(); | ||
| logger.setLevel(Level.DEBUG); | ||
| logger.addAppender(appender); | ||
| } | ||
|
|
||
| @AfterEach | ||
| void resetMocks() { | ||
| ((Logger) LogManager.getLogger(HoodieWriteCommitHttpCallbackClient.class)).removeAppender(appender); | ||
| Logger logger = (Logger) LogManager.getLogger(HoodieWriteCommitHttpCallbackClient.class); | ||
| logger.setLevel(initialLogLevel); | ||
| logger.removeAppender(appender); | ||
| reset(appender, httpClient, httpResponse, statusLine); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add these overrides to the config instead of needing to specify them here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the shade and dependency plugin, I didn't find a way to specify the log level in the configuration of the plugin unfortunately. We could put these in a basic logging configuration file that maven uses as well though.
For the
-ntp -B -V, that will need to be hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. You're saying if you specify the logs it in props for these loggers it's not not picked up?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can specify a logging configuration for maven itself if we want and configure the simple logger there. Some plugins allow you to set the log level in their configuration but these plugins do not have that option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would be preferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried debugging this for a couple of hours but it looks like maven will not pick up our properties file so I am going to revert back to manually specifying the strings in the build file