---
title: "PostgreSQL TimescaleDB cluster logs"
sidebar_label: "Cluster logs"
sidebar_position: 11
description: "How to enable PostgreSQL TimescaleDB cluster logging, how to get logs, and how to disable 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';

# PostgreSQL TimescaleDB cluster logs

The [Logs](/logs/) service is used for logging. Learn more about how the service works and its pricing in the [Logs service description](/logs/about/about-logs.mdx) article. You can check the availability of the Logs service by location in the [Logs availability by location](/logs/about/logs-availability-by-location.mdx).

For a PostgreSQL TimescaleDB Managed Database cluster, events in the PostgreSQL databases and the PgBouncer connection pooler are logged.

To collect cluster logs in the Logs service, you need to [enable logging](#enable-logs). [You can retrieve logs](#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.

Read more about PostgreSQL database logging in the [Error Reporting and Logging](https://www.postgresql.org/docs/current/runtime-config-logging.html) PostgreSQL documentation.

## Enable logging \{#enable-logs}

<EnableLogs DatabaseName="PostgreSQL TimescaleDB" slug="timescaledb" ArticleName="Monitoring of the cluster, nodes and databases PostgreSQL TimescaleDB" />

## Get logs \{#get-logs}

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

для кластера Managed Database для PostgreSQL TimescaleDB будут созданы потоки событий `postgresql.log-<instance_id>` and `pgbouncer.log-<instance_id>`, где `<instance_id>` – идентификатор ноды кластера PostgreSQL TimescaleDB.

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

## Log fields \{#fields}

<CustomTable>
  <table>
    <tbody>
      <tr>
        <th>\_HOSTNAME</th><td>имя ноды кластера in формате `dbaas-<instance_id>`, где `<instance_id>` – идентификатор ноды кластера PostgreSQL TimescaleDB</td>
      </tr>

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

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

      <tr>
        <th>MESSAGE</th><td>Event description provided by the log source</td>
      </tr>
    </tbody>
  </table>
</CustomTable>

## Disable logging \{#disable-logs}

<DisableLogs />

<Formbricks />
