默认日志路径

Hive 的 log 默认存放在/tmp/xxx/hive.log 目录下(当前用户名下)

tail -f hive.log

此命令显示文件的最后 10 行。不断刷新,只要日志文件更新就可以看到最新的文件内容,直到您按下(Ctrl-C)组合键停止显示。

cat 是静态查看文件内容

tail 是动态查看文件内容

tail -n +20 notes.log

tail -c 10 notes.log

-f 循环读取

-q 不显示处理信息

-v 显示详细的处理信息

-c<数目> 显示的字节数

-n<行数> 显示文件的尾部 n 行内容

--pid=PID 与-f合用,表示在进程ID,PID死掉之后结束

-q, --quiet, --silent 从不输出给出文件名的首部

-s, --sleep-interval=S 与-f合用,表示在每次反复的间隔休眠S秒

修改日志路径

修改 hive 的 log 存放日志到/opt/module/hive/logs

/opt/module/hive/conf/hive-log4j2.properties.template改为hive-log4j2.properties

mv hive-log4j2.properties.template hive-log4j2.properties

在 hive-log4j2.properties 文件中修改 log 存放位置

hive.log.dir=/opt/module/hive/logs

推荐阅读

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: