This sounds fairly reasonable, though I haven’t looked at implementation details. We should make a Jira ticket to track the change. Otherwise, I think it’s a good idea to support the syntax.
— Matt Sicker > On Jan 9, 2022, at 09:02, 张铎 <[email protected]> wrote: > > I brought this up in the incubator mailing list, and was suggested to > report directly to the log4j community. > > https://issues.apache.org/jira/browse/HADOOP-16206 > > In hadoop we started to try migrating to log4j2 long ago, but it is not > easy. For now, one of the most blocker issues is the lack of support of > 'log4j.rootLogger=INFO,Console' grammar. Notice that we do not want to stay > on the bridge api, we want to fully migrate to log4j2 finally, so > supporting the above grammar in log4j1 bridge is not enough. > > This is the main log4j configuration file for hadoop > > https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/conf/log4j.properties > > We have this in the file > > # Define the root logger to the system property "hadoop.root.logger". >> log4j.rootLogger=${hadoop.root.logger} > > > So our users could simply pass -Dhadoop.root.logger to control the level > and appender. > > https://github.com/apache/hadoop/blob/39efbc6b6fe53abed15f5639edcbaaa2a9dda6d2/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh#L904 > > Here we use an environment variable in our start up scripts. And I believe > there are lots of other hadoop deployment systems which will have their own > start scripts. > > So in general, it is just impossible for us to drop the > -Dhadoop.root.logger way of configuring our logging system. > > So here I want to ask if it is possible for log4j2 to still support the > 'log4j.rootLogger=INFO,Console' grammar. I'm not saying you must add it > back with no change, we just need a way to configure the level and appeners > at once, so something like > 'log4j2.rootLogger.levelAndAppender=INFO,Console' is also OK. > > Thanks.
