跳转到主内容
跳转到主内容

system.error_log

在 ClickHouse Cloud 中进行查询

该系统表中的数据保存在 ClickHouse Cloud 中每个节点的本地。因此,如需获得所有数据的完整视图,需要使用 clusterAllReplicas 函数。更多详情请参阅此处

描述

包含来自表 system.errors 的错误统计历史记录,这些数据会定期写入磁盘。

  • hostname (LowCardinality(String)) — 执行查询的服务器主机名。
  • event_date (Date) — 事件日期。
  • event_time (DateTime) — 事件时间。
  • code (Int32) — 错误代码编号。
  • error (LowCardinality(String)) — 错误名称。
  • value (UInt64) — 该错误发生的次数。
  • remote (UInt8) — 远程异常 (即在某个分布式查询期间收到的异常) 。
  • last_error_time (DateTime) — 上一次发生错误的时间。
  • last_error_message (String) — 上一次错误的消息。
  • last_error_query_id (String) — 导致上一次错误的查询 ID (如果可用) 。
  • last_error_trace (Array(UInt64)) — 堆栈跟踪,表示已调用方法所在物理地址的列表。

示例

SELECT * FROM system.error_log LIMIT 1 FORMAT Vertical;
Row 1:
──────
hostname:            clickhouse.testing.internal
event_date:          2025-11-11
event_time:          2025-11-11 11:35:28
code:                60
error:               UNKNOWN_TABLE
value:               1
remote:              0
last_error_time:     2025-11-11 11:35:28
last_error_message:  Unknown table expression identifier 'system.table_not_exist' in scope SELECT * FROM system.table_not_exist
last_error_query_id: 77ad9ece-3db7-4236-9b5a-f789bce4aa2e
last_error_trace:    [100506790044914,100506534488542,100506409937998,100506409936517,100506425182891,100506618154123,100506617994473,100506617990486,100506617988112,100506618341386,100506630272160,100506630266232,100506630276900,100506629795243,100506633519500,100506633495783,100506692143858,100506692248921,100506790779783,100506790781278,100506790390399,100506790380047,123814948752036,123814949330028]

另请参阅