---
title: "Kafka cluster logs"
sidebar_label: "Cluster logs"
sidebar_position: 9
description: "How to enable Kafka cluster logging, get logs, and disable cluster logging"
---

import Formbricks from '@theme/MDXComponents/Formbricks';
import EnableLogs from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/managed-databases/common/enable-logs.mdx';
import DisableLogs from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/managed-databases/common/disable-logs.mdx';
import { CustomTable } from '@selectel/docux/components';

# Kafka cluster logs

For logging, the [Logs](/logs/) service is used. For more details on how the service works and its pricing, see the [General Information about the Logs service](/logs/about/about-logs.mdx) article. You can check the availability of the Logs service in regions in the [availability matrix](/infrastructure/product-availability-by-location.mdx#logs).

For a Kafka Managed Database cluster, events within the Kafka Controller and Kafka Broker components are logged.

To collect cluster logs in the Logs service, [enable logging](#enable-logs). [Logs can be retrieved](#get-logs) in the Control Panel, using API requests, or via [AWS CLI](/logs/tools/aws-cli.mdx). If you no longer need to collect logs, you can [disable logging](#disable-logs).

Logs are stored for 30 days.

## Enable logging \{#enable-logs}

<EnableLogs DatabaseName="Kafka" ArticleName="Monitoring of the cluster and nodes Kafka" slug="kafka" />

## Get logs \{#get-logs}

Follow the [Get logs](/logs/manage/get-logs.mdx) instruction in the Logs section.

Event streams `kafka-controller.log-<instance_id>` and `kafka-broker.log-<instance_id>`, where `<instance_id>` is a Kafka cluster node ID, have been created for the Kafka Managed Database cluster.\</g.

See the description of [log fields](#fields) for a Kafka cluster.

## Log fields \{#fields}

<CustomTable>
  <table>
    <tbody>
      <tr>
        <th>\_HOSTNAME</th><td>Cluster node name in the `dbaas-<instance_id>` format, where `<instance_id>` is a Kafka cluster node ID\</g</td>
      </tr>

      <tr>
        <th>SYSLOG\_IDENTIFIER</th><td>Log source name</td>
      </tr>

      <tr>
        <th>SYSLOG\_TIMESTAMP</th><td>Event time in the log</td>
      </tr>

      <tr>
        <th>MESSAGE</th><td>Description of the event submitted by the log source</td>
      </tr>
    </tbody>
  </table>
</CustomTable>

## Disable logging \{#disable-logs}

<DisableLogs />

<Formbricks />
