Skip to main content
If you need to monitor your cluster, tune performance, or troubleshoot 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 cockroach command, 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 Notable Event Types.
  • An envelope that contains event metadata (e.g., severity, date, timestamp, channel). Depending on the log format you specify when configuring logs, 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 use cases. For more information on configuring sinks and severity levels, see Configure Logs.
All cockroach commands support logging. However, note that most messages related to cluster operation are generated by cockroach start or cockroach start-single-node. 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 how log messages are routed to different sinks and adjust verbosity levels, but you cannot turn off a log channel entirely. For example, a channel that is not explicitly configured for a file group is enabled in the default file group.
Log messages in CockroachDB are directed into logging channels, which can in turn be assigned to output to one or more log sinks. 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 Logging Use Cases. 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 Logging reference.

Logging destinations

When using the default logging configuration, the events collected on each logging channel are split into log files as follows: Logging destinations and many other parameters are configurable via YAML. For details, see Configure Logs.

See also