赞
踩
Hive的log默认存放在/tmp/atguigu/hive.log目录下(当前用户名下)
修改hive的log日志到指定的位置上,我打算放到 /root/soft/hive-1.2.1/hive_logs 目录下, 你们随意,
去/root/soft/hive-1.2.1/conf 目录下面修改hive-log4j.properties 文件
修改 hive.log.dir属性配置信息
下面是hive-log4j.properties文件
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 # Logging Threshold log4j.threshold=${hive.log.threshold} # # Daily Rolling File Appender # # Use the PidDailyerRollingFileAppend class instead if you want to use separate log files # for different CLI session.
修改完了重新执行hive,随便操作点什么
[root@zjj101 hive_logs]# cat hive.log 2020-09-13 17:12:42,572 ERROR [main]: DataNucleus.Datastore (Log4JLogger.java:error(115)) - Error thrown executing ALTER TABLE `PARTITIONS` ADD COLUMN `TBL_ID` BIGINT NULL : Table 'metastore.PARTITIONS' doesn't exist java.sql.SQLSyntaxErrorException: Table 'metastore.PARTITIONS' doesn't exist at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764) at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648) at com.jolbox.bonecp.StatementHandle.execute(StatementHandle.java:254) at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement(AbstractTable.java:760) at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatementList(AbstractTable.java:711) at org.datanucleus.store.rdbms.table.TableImpl.validateColumns(TableImpl.java:259) at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:3393) at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:3190) at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2841) at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:122) at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:1605)
就能查看到日志了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。