修改配置文件
需要这个配置文件: “hive-1.2.1/conf/hive-log4j.properties”
大概在第七行,修改hive.root.logger属性, 可以是 DEBUG,console 也可以是 info,console
debug级别打印的东西比较多,比较精细.但是控制台很乱,
info就简练一些了.
hive-log4j.properties文件的hive.root.logger 的属性.
hive.log.dir=/root/soft/hive-1.2.1/hive_logs
hive.log.file=hive.log
# Define the root logger to the system property "hadoop.root.logger".
log4j.rootLogger=${hive.root.logger}, EventCounter
# hive.root.logger =DEBUG,console
hive.root.logger =info,console
# Logging Threshold
log4j.threshold=${hive.log.threshold}
重启程序尝试
修改完了重启Hive进程,再操作就发现日志都是info级别了
20/11/13 14:14:55 [main]: INFO exec.ListSinkOperator: 0 finished. closing...
20/11/13 14:14:55 [main]: INFO exec.ListSinkOperator: 0 Close done
Time taken: 1.583 seconds, Fetched: 1 row(s)
20/11/13 14:14:55 [main]: INFO CliDriver: Time taken: 1.583 seconds, Fetched: 1 row(s)
20/11/13 14:14:55 [main]: INFO log.PerfLogger: <PERFLOG method=releaseLocks from=org.apache.hadoop.hive.ql.Driver>
20/11/13 14:14:55 [main]: INFO log.PerfLogger: </PERFLOG method=releaseLocks start=1605248095573 end=1605248095573 duration=0 from=org.apache.hadoop.hive.ql.Driver>
hive (default)>