You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/08/16 20:22:00 UTC

[jira] [Commented] (IMPALA-7455) log4j2 can sneak into classpath and break logging

    [ https://issues.apache.org/jira/browse/IMPALA-7455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16583021#comment-16583021 ] 

ASF subversion and git services commented on IMPALA-7455:
---------------------------------------------------------

Commit 59435fe0a9237eb4772eff10b56840820d5c38f8 in impala's branch refs/heads/master from [~philip]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=59435fe ]

IMPALA-7455: Exclude another log4j artifact.

log4j-1.2-api-2.8.2.jar is the "log4j2 bridge for log4j 1.2 api", and,
if it is included on the classpath before log4j-1.2.17.jar, frontend
logging doesn't work. This results in tests that look for logs in the
frontend (like test_disable_catalog_data_ops and
test_jvm_pause_monitor_logs_entries) failing.

Interestingly, this is possible because the sorting of
shell globs differs depending on the locale settings. To wit:

  $ LC_ALL=en_US.UTF-8 bash -c 'echo fe/target/dependency/*' | tr ' ' '\n' | grep log4j
  fe/target/dependency/log4j-1.2.17.jar
  fe/target/dependency/log4j-1.2-api-2.8.2.jar
  fe/target/dependency/log4j-api-2.8.2.jar
  fe/target/dependency/log4j-core-2.8.2.jar
  fe/target/dependency/log4j-web-2.8.2.jar
  fe/target/dependency/slf4j-log4j12-1.7.25.jar

  $ LC_ALL=C bash -c 'echo fe/target/dependency/*' | tr ' ' '\n' | grep log4j
  fe/target/dependency/log4j-1.2-api-2.8.2.jar
  fe/target/dependency/log4j-1.2.17.jar
  fe/target/dependency/log4j-api-2.8.2.jar
  fe/target/dependency/log4j-core-2.8.2.jar
  fe/target/dependency/log4j-web-2.8.2.jar
  fe/target/dependency/slf4j-log4j12-1.7.25.jar

Change-Id: Ibd32be96cd3d668a77abaff4807963155449c95b
Reviewed-on: http://gerrit.cloudera.org:8080/11247
Reviewed-by: Fredy Wijaya <fw...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> log4j2 can sneak into classpath and break logging
> -------------------------------------------------
>
>                 Key: IMPALA-7455
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7455
>             Project: IMPALA
>          Issue Type: Task
>            Reporter: Philip Zeyliger
>            Priority: Major
>
> {{bin/set-classpath}} sets the classpath based on {{fe/target/dependency/*}} and uses a shell glob. These globs are sorted according to your locale settings. The sorting differs between the C locale and the {{en_US.UTF-8}} locale:
> {code}
> impdev@phiblip:~/Impala$ LC_ALL=en_US.UTF-8 bash -c 'echo fe/target/dependency/*' | tr ' ' '\n' | grep log4j
> fe/target/dependency/log4j-1.2.17.jar
> fe/target/dependency/log4j-1.2-api-2.8.2.jar
> fe/target/dependency/log4j-api-2.8.2.jar
> fe/target/dependency/log4j-core-2.8.2.jar
> fe/target/dependency/log4j-web-2.8.2.jar
> fe/target/dependency/slf4j-log4j12-1.7.25.jar
> impdev@phiblip:~/Impala$ LC_ALL=C bash -c 'echo fe/target/dependency/*' | tr ' ' '\n' | grep log4j
> fe/target/dependency/log4j-1.2-api-2.8.2.jar
> fe/target/dependency/log4j-1.2.17.jar
> fe/target/dependency/log4j-api-2.8.2.jar
> fe/target/dependency/log4j-core-2.8.2.jar
> fe/target/dependency/log4j-web-2.8.2.jar
> fe/target/dependency/slf4j-log4j12-1.7.25.jar
> {code}
> When the {{LC_ALL=C}} locale is in play, you get logs like the following in custom cluster tests:
> {code}
> $cat impalad.philip-dev.gce.cloudera.com.philip.log.ERROR.20180815-093713.22141
> Log file created at: 2018/08/15 09:37:13
> Running on machine: philip-dev.gce.cloudera.com
> Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
> E0815 09:37:13.841073 22141 logging.cc:121] stderr will be logged to this file.
> ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
> {code}
> What I think is going on is the following dependency pulled in via {{hive-exec}}:
> {code}
> [INFO] +- org.apache.hive:hive-exec:jar:2.1.1-cdh6.x-SNAPSHOT:compile
> [INFO] |  +- org.apache.logging.log4j:log4j-1.2-api:jar:2.8.2:compile
> {code}
> Impala configures log4j manually in {{GlogAppender.Install()}} that uses log4j-1.2 (and not log4j2) configuration.
> I'll be trying to rip out this dependency and see what happens.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org