Skip to main content
If you need to monitor your cluster, tune performance, or issues, you can check the CockroachDB logs, which include details about notable cluster, node, and range-level events.

Details

When a node starts, shuts down, or processes a , it produces a stream of messages about the command’s activities. Each message is composed of:
  • A payload that contains events either structured in JSON or conveyed in an arbitrary string. For details on structured event types and their fields, see .
  • An envelope that contains event metadata (e.g., severity, date, timestamp, channel). Depending on the log format you specify when , the envelope can be formatted either in JSON or as a flat prefix to the message.
Messages are organized into appropriate logging channels and then routed through log sinks. Each sink further processes and filters the messages before emitting them to destinations outside CockroachDB. The mapping of channels to sinks, as well as the processing and filtering done by each sink, is configurable and is intended to support multiple . For more information on configuring sinks and severity levels, see .
All support logging. However, note that most messages related to cluster operation are generated by or . Other commands generate messages related to their own execution, which are mainly useful when troubleshooting the behaviors of those commands.

Logging channels

Log channels cannot be completely disabled. You can configure and , but you cannot turn off a log channel entirely. For example, a channel that is not explicitly configured for a is enabled in the default file group.
Log messages in CockroachDB are directed to logging channels, which can in turn be assigned to output to one or more . This allows you to group channels that log related information (e.g., operational, security, or SQL events) into their own sinks. Each sink can output to a predetermined destination where the logs can be collected and parsed. For usage examples, see .
ChannelDescription
Changefeed events.

Note: , which are sent by default to the TELEMETRY channel in v26.3 and earlier versions, will be routed by default to this channel in a future major release.
To prepare for that change and assess potential downstream impacts on your logging setup and pipelines, review the cluster setting. After reviewing the documentation, set log.channel_compatibility_mode.enabled to false in a non-production environment to log these events to this CHANGEFEED channel.
Uncategorized and debug messages.
Data distribution events, such as moving between in a cluster, adding replicas to , and removing replicas from ranges.
KV execution events that are not related to distribution.
Resource usage; node-node connection events, including connection errors; up- and down-replication and range unavailability.
Process starts, stops, shutdowns, and crashes (if they can be logged); changes to cluster topology, such as node additions, removals, and decommissions.
Changes to privileges and object ownership.
SQL audit events (when enabled via ).
Client connections and disconnections (when enabled via the server.auth_log.sql_connections.enabled ); SQL authentication logins/attempts and session/query terminations (when enabled via the server.auth_log.sql_sessions.enabled ).
SQL statement executions (when enabled via the sql.trace.log_statement_execute ) and uncaught Go panic errors during SQL statement execution.

Warning: Logging cluster-wide executions by enabling the sql.trace.log_statement_execute cluster setting will incur considerable overhead and may have a negative performance impact.

Note: In a future release, the following events will be routed to this channel:
To prepare for that change and assess potential downstream impacts on your logging setup and pipelines, set the log.channel_compatibility_mode.enabled cluster setting to false in a non-production environment. This will log these events to this SQL_EXEC channel.
To prepare for that change and assess potential downstream impacts on your logging setup and pipelines, set the log.channel_compatibility_mode.enabled cluster setting to false in a non-production environment. This will log these events to this SQL_EXEC channel.
SQL executions that impact performance, such as slow queries (enabled via the sql.log.slow_query.latency_threshold and sql.log.slow_query.experimental_full_table_scans.enabled ).

Note: The SQL_PERF and SQL_INTERNAL_PERF channels will be removed in a future release. and events currently sent to the SQL_PERF and channels, respectively, will be routed to the SQL_EXEC channel in a future release. Internal queries are tagged as internal, allowing users to filter them out downstream.

To prepare for that change and assess potential downstream impacts on your logging setup and pipelines, set the log.channel_compatibility_mode.enabled cluster setting to false in a non-production environment. This logs these events to the SQL_EXEC channel.
Database, schema, table, sequence, view, and type creation; changes to table columns and sequence parameters.
Low-level storage logs from the .
Telemetry events for internal usage, except for and events which may be .

Note: sampled_query and sampled_transaction events, which are sent by default to this channel in v26.3 and earlier versions, will instead be routed by default to the SQL_EXEC channel in a future major release. , which are sent by default to this channel in v26.3 and earlier versions, will instead be routed by default to the CHANGEFEED channel in a future major release.
To prepare for these changes and assess potential downstream impacts on your logging setup and pipelines, review the cluster setting. After reviewing the documentation, set log.channel_compatibility_mode.enabled to false in a non-production environment to log these events to their new channels.
Changes to users, roles, and authentication credentials.
Logging channels are analogous to logging facilities in Syslog or logging services in Datadog. For more details on the contents of each logging channel, see the .

log.channel_compatibility_mode.enabled

The log.channel_compatibility_mode.enabled controls logging channel behavior. When set to:
  • true (default): Logs are sent to the standard logging channels. This maintains the behavior in v25.3 and earlier supported versions. Specifically, the system sends:
  • false: Logs are sent to updated logging channels. Specifically, the system sends:
In a future release, log.channel_compatibility_mode.enabled is expected to default to false. To prepare for that change and assess potential downstream impacts on your logging setup and pipelines, set the log.channel_compatibility_mode.enabled cluster setting to false in a non-production environment.

Logging destinations

When using the , the events collected on each logging channel are split into log files as follows:
FilenameDescriptionChannels
cockroach.logGeneral CockroachDB logDEV
cockroach-changefeed.logChangefeed logCHANGEFEED
cockroach-health.logHealth logHEALTH
cockroach-kv-distribution.logData distribution logKV_DISTRIBUTION
cockroach-kv-exec.logKV execution logKV_EXEC
cockroach-security.logSQL security logPRIVILEGES + USER_ADMIN
cockroach-sql-audit.logSQL access audit logSENSITIVE_ACCESS
cockroach-sql-auth.logSQL authentication logSESSIONS
cockroach-sql-exec.logSQL execution logSQL_EXEC
cockroach-sql-slow.logSQL slow query logSQL_PERF
cockroach-sql-schema.logSQL schema change logSQL_SCHEMA
cockroach-pebble.logPebble logSTORAGE
cockroach-telemetry.logTelemetry logTELEMETRY
Logging destinations and many other parameters are configurable via YAML. For details, see .

See also