CDH5和CDH6开启审计日志的方式有点区别
免费拿走不谢
CDH6.x Hive的版本的2.x,使用的log4j2,开启审计日志如下:
appenders=AUDIT
appender.AUDIT.type=RollingRandomAccessFile
appender.AUDIT.name=AUDIT
appender.AUDIT.fileName=${log.dir}/hive_audit.log
appender.AUDIT.filePattern=${log.dir}/hive_audit.%d{yyyy-MM-dd}
appender.AUDIT.layout.type=PatternLayout
appender.AUDIT.layout.pattern=%d{DEFAULT} %-5p %c: [%t]: %m%n
appender.AUDIT.policies.type=Policies
appender.AUDIT.policies.size.type=SizeBasedTriggeringPolicy
appender.AUDIT.policies.size.size=${max.log.file.size}
appender.AUDIT.strategy.type=DefaultRolloverStrategy
appender.AUDIT.strategy.max=${max.log.file.backup.index}
loggers = audit
logger.audit.name = org.apache.hadoop.hive.metastore.HiveMetaStore.audit
logger.audit.level = info
logger.audit.additivity = false
logger.audit.appenderRef=audit
logger.audit.appenderRef.audit.ref = AUDIT
CDH5.x Hive的版本的1.x,使用的log4j,开启审计日志如下:
log4j.appender.HAUDIT=org.apache.log4j.DailyRollingFileAppender
log4j.appender.HAUDIT.File=/var/log/hive/hive_audit.log
log4j.appender.HAUDIT.DatePattern=.yyyy-MM-dd
log4j.appender.HAUDIT.layout=org.apache.log4j.PatternLayout
log4j.appender.HAUDIT.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
log4j.logger.org.apache.hadoop.hive.metastore.HiveMetaStore.audit=INFO,HAUDIT