---
title: "PostgreSQL for 1C cluster logs"
sidebar_label: "Cluster logs"
sidebar_position: 10
description: "How to enable PostgreSQL for 1C 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';

# PostgreSQL for 1C cluster logs

Logging uses the [Logs](/logs/) service. For more information about how the service works and its cost, see the [Logs Service Overview](/logs/about/about-logs.mdx) guide. You can check the availability of the Logs service across locations in the [Logs Availability by Location](/logs/about/logs-availability-by-location.mdx).

For a PostgreSQL for 1C Managed Database cluster, events in PostgreSQL databases are logged.

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

For more information about logging in PostgreSQL databases, see the [Error Reporting and Logging](https://www.postgresql.org/docs/current/runtime-config-logging.html) guide in the PostgreSQL documentation.

## Enable logging \{#enable-logs}

<EnableLogs DatabaseName="PostgreSQL for 1C" ArticleName="Monitoring of the cluster, nodes and databases PostgreSQL for 1C" slug="postgresql-for-1c" />

## Get logs \{#get-logs}

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

An event stream `postgresql.log-<instance_id>` will be created for the PostgreSQL for 1C Managed Database cluster, where `<instance_id>` is the node ID of the PostgreSQL for 1C cluster.

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

## Log fields \{#fields}

<CustomTable>
  <table>
    <tbody>
      <tr>
        <th>\_HOSTNAME</th><td>Cluster node name in the format `dbaas-<instance_id>`, where `<instance_id>` is the node ID of the PostgreSQL for 1C cluster</td>
      </tr>

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

      <tr>
        <th>SYSLOG\_TIMESTAMP</th><td>Log event time</td>
      </tr>

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

## Disable logging \{#disable-logs}

<DisableLogs />

<Formbricks />
