From 8a5299015045600345d50ac41ab3264c0baec03d Mon Sep 17 00:00:00 2001 From: slfan1989 <55643692+slfan1989@users.noreply.github.com> Date: Wed, 28 Jun 2023 01:52:59 +0800 Subject: [PATCH] YARN-11519. [Federation] Add RouterAuditLog to log4j.properties. (#5785) --- .../hadoop-common/src/main/conf/log4j.properties | 15 +++++++++++++++ hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/conf/log4j.properties b/hadoop-common-project/hadoop-common/src/main/conf/log4j.properties index b4eec1fe2c..873e836680 100644 --- a/hadoop-common-project/hadoop-common/src/main/conf/log4j.properties +++ b/hadoop-common-project/hadoop-common/src/main/conf/log4j.properties @@ -232,6 +232,21 @@ log4j.appender.NMAUDIT.layout.ConversionPattern=%d{ISO8601}%p %c{2}: %m%n log4j.appender.NMAUDIT.MaxFileSize=${nm.audit.log.maxfilesize} log4j.appender.NMAUDIT.MaxBackupIndex=${nm.audit.log.maxbackupindex} +# +# YARN Router audit logging +# +router.audit.logger=INFO,NullAppender +router.audit.log.maxfilesize=256MB +router.audit.log.maxbackupindex=20 +log4j.logger.org.apache.hadoop.yarn.server.router.RouterAuditLogger=${router.audit.logger} +log4j.additivity.org.apache.hadoop.yarn.server.router.RouterAuditLogger=false +log4j.appender.ROUTERAUDIT=org.apache.log4j.RollingFileAppender +log4j.appender.ROUTERAUDIT.File=${hadoop.log.dir}/router-audit.log +log4j.appender.ROUTERAUDIT.layout=org.apache.log4j.PatternLayout +log4j.appender.ROUTERAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n +log4j.appender.ROUTERAUDIT.MaxFileSize=${router.audit.log.maxfilesize} +log4j.appender.ROUTERAUDIT.MaxBackupIndex=${router.audit.log.maxbackupindex} + # HS audit log configs #mapreduce.hs.audit.logger=INFO,HSAUDIT #log4j.logger.org.apache.hadoop.mapreduce.v2.hs.HSAuditLogger=${mapreduce.hs.audit.logger} diff --git a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh index b6c2aaf094..8d2ab06578 100644 --- a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh +++ b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh @@ -158,7 +158,7 @@ # # See ResourceManager for some examples # -#export YARN_ROUTER_OPTS= +#export YARN_ROUTER_OPTS="-Drouter.audit.logger=INFO,ROUTERAUDIT" ### # Global Policy Generator specific parameters