Skip to main content

ListLogs

Retrieves logs for the specified PostgreSQL cluster.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const ListClusterLogsRequest =
cloudApi.mdb.clickhouse_cluster_service.ListClusterLogsRequest;
const ListClusterLogsRequest_ServiceType =
cloudApi.mdb.clickhouse_cluster_service.ListClusterLogsRequest_ServiceType;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ClusterServiceClient);

const result = await client.listLogs(
ListClusterLogsRequest.fromPartial({
clusterId: "clusterId",
// columnFilter: ["columnFilter"],
serviceType: ListClusterLogsRequest_ServiceType.CLICKHOUSE,
// fromTime: {
// seconds: 0,
// nanos: 0
// },
// toTime: {
// seconds: 0,
// nanos: 0
// },
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListClusterLogsRequest

ServiceType

  • SERVICE_TYPE_UNSPECIFIED

  • POSTGRESQL

    Logs of PostgreSQL activity.

  • POOLER

    Logs of connection pooler activity.

clusterId : string

ID of the PostgreSQL cluster to request logs for. To get the PostgreSQL cluster ID use a ClusterService.List request.

columnFilter : string

Columns from the logs table to request. If no columns are specified, entire log records are returned.

serviceType : ServiceType

Type of the service to request logs about.

fromTime : google.protobuf.Timestamp

Start timestamp for the logs request, in RFC3339 text format.

toTime : google.protobuf.Timestamp

End timestamp for the logs request, in RFC3339 text format.

pageSize : int64

The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListClusterLogsResponse.next_page_token that can be used to get the next page of results in subsequent list requests.

pageToken : string

Page token. To get the next page of results, set page_token to the ListClusterLogsResponse.next_page_token returned by the previous list request.

alwaysNextPageToken : bool

Always return next_page_token, even if current page is empty.

ListClusterLogsResponse

logs : LogRecord

Requested log records.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is larger than ListClusterLogsRequest.page_size, use the next_page_token as the value for the ListClusterLogsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results. This value is interchangeable with next_record_token from StreamLogs method.

LogRecord

timestamp : google.protobuf.Timestamp

Log record timestamp in RFC3339 text format.

message : string

Contents of the log record.