Skip to content

Allow to write ClickHouse text logs into system table. #6037

@alexey-milovidov

Description

@alexey-milovidov

Motivation:

  • logs will be stored in structured format for easy and efficient searching, visualization and analytics, even in distributed clusters;
  • allow to store data for larger periods of time due to better compression and usability;
  • the user will be able to fine tune TTL in ClickHouse and to store old text logs in files for shorter time;
  • allow to store more fields in structured log.

Downsides:

  • logs in system tables are available only if clickhouse-server is alive; but it's Ok, because text logs in files will be available nevertheless.

Look for SystemLog.h and QueryLog, QueryThreadLog, PartLog for implementation. Proposed name: TextLog, system.text_log.

Fields (already existing in text log):

  • event_date Date;
  • event_time DateTime;
  • microseconds UInt32;
  • thread_number UInt32;
  • query_id String;
  • level Enum;
  • logger_name String;
  • message String;

Fields (extra):

  • os_thread_id UInt32;
  • thread_name LowCardinality(String);
  • server version and revision fields similar to query_log;
  • source_file LowCardinality(String); - information about source file location;
  • source_line UInt64;

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions