修改配置文件

需要这个配置文件: “hive-1.2.1/conf/hive-log4j.properties”

大概在第七行,修改hive.root.logger属性, 可以是 DEBUG,console 也可以是 info,console

debug级别打印的东西比较多,比较精细.但是控制台很乱,

info就简练一些了.

hive-log4j.properties文件的hive.root.logger 的属性.

  1. hive.log.dir=/root/soft/hive-1.2.1/hive_logs
  2. hive.log.file=hive.log
  3. # Define the root logger to the system property "hadoop.root.logger".
  4. log4j.rootLogger=${hive.root.logger}, EventCounter
  5. # hive.root.logger =DEBUG,console
  6. hive.root.logger =info,console
  7. # Logging Threshold
  8. log4j.threshold=${hive.log.threshold}

重启程序尝试

修改完了重启Hive进程,再操作就发现日志都是info级别了

  1. 20/11/13 14:14:55 [main]: INFO exec.ListSinkOperator: 0 finished. closing...
  2. 20/11/13 14:14:55 [main]: INFO exec.ListSinkOperator: 0 Close done
  3. Time taken: 1.583 seconds, Fetched: 1 row(s)
  4. 20/11/13 14:14:55 [main]: INFO CliDriver: Time taken: 1.583 seconds, Fetched: 1 row(s)
  5. 20/11/13 14:14:55 [main]: INFO log.PerfLogger: <PERFLOG method=releaseLocks from=org.apache.hadoop.hive.ql.Driver>
  6. 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>
  7. hive (default)>