본문 바로가기
빅데이터/oozie

[oozie] 우지 액션의 log4j 설정 추가

by hs_seo 2019. 11. 4.

우지 5.0에서 log4j 설정을 읽지 못해서 발생하는 오류는 우지의 쉐어라이브러리에 log4j 설정을 복사해서 적용할 수 있습니다.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/mnt/yarn/filecache/56/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Logging initialized using configuration in /mnt/yarn/usercache/hadoop/appcache/application_1572396391225_0324/container_1572396391225_0324_01_000001/hive-log4j.properties Async: true

우지 Hive 액션의 로그 설정

우지 하이브 액션에서 사용하는 log4j 설정은 다음의 위치에서 확인할 수 있습니다.

public static final String HIVE_L4J_PROPS = "hive-log4j.properties";
public static final String HIVE_EXEC_L4J_PROPS = "hive-exec-log4j.properties";

해결방법

쉐어라이브러리 위치를 확인하고 log4j 설정을 추가하여 줍니다.

쉐어 라이브러리 위치에 log4j 설정 추가

쉐어라이브러리 위치는 oozie-site.xml에 다음의 위치에 설정됩니다.

    <property>
        <name>oozie.service.WorkflowAppService.system.libpath</name>
        <value>/user/${user.name}/share/lib</value>
    </property>

HDFS에 추가

위에서 확인한 쉐어라이브러리 위치에 log4j 설정을 복사합니다.

$ hadoop fs -put log4j.properties /user/oozie/share/lib/hive/hive-log4j.properties
$ hadoop fs -put log4j.properties /user/oozie/share/lib/hive/hive-exec-log4j.properties
$ hadoop fs -put log4j.properties /user/oozie/share/lib/hive/log4j.properties
$ hadoop fs -put log4j.properties /user/oozie/share/lib/hive/log4j2.properties

설정 추가후 우지가 인식하지 못하면 쉐어 라이브러리 설정을 갱신하여 줍니다.

$ oozie admin -sharelibupdate

log4j 설정

appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{yyyy-MM-dd HH:mm:ss}] [%-5p] [%c{1}:%L] - %m%n

rootLogger.level = debug
rootLogger.appenderRef.console.ref = console
반응형