Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7455

log4j2 can sneak into classpath and break logging

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • ghx-label-7

    Description

      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:

      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
      

      When the LC_ALL=C locale is in play, you get logs like the following in custom cluster tests:

      $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.
      

      What I think is going on is the following dependency pulled in via hive-exec:

      [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
      

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            philip Philip Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: