logo
Alauda support for PostgreSQL
logo
Alauda support for PostgreSQL
Navigation
Introduction
Release Notes
Lifecycle Policy
Installation
Upgrade
Architecture

Guides

Create Instance
Delete Instance
Instance Details
Backup and Restore
Scheduling Configuration
Log
Monitoring

HowTo

Configuring a High Availability PostgreSQL Cluster

Trouble Shooting

Cluster Creation Failure
Master-Slave Switch Exception
Backup and Restore Failure
Permissions

API Reference

Kubernetes APIs

PostgreSQL APIs

Postgresqls
PostgresBackup
PostgresRestore
📝 Edit this page on GitHub
Previous PageScheduling Configuration
Next PageMonitoring

#Log

#TOC

#Introduction

PostgreSQL provides a robust logging system, including detailed error logs. Understanding these logs, which capture events during instance operation at the container level within your Kubernetes cluster, is crucial. Proper analysis of logs, especially error logs, helps you quickly identify the root cause of issues, troubleshoot effectively, and handle faults or exceptions promptly.

#Procedure

CLI
Web Console
  1. View all related pods of the instance. Replace ${namespace} with the actual namespace and ${instance_name} with the instance name. Use the appropriate label selector for your PostgreSQL instance.

    # Example using the standard Alauda label selector
    kubectl get pod -n ${namespace} -l "middleware.instance/name=${instance_name}"
  2. Query the logs for a specific pod's postgres container. Replace ${namespace} and ${pod_name} with the actual values.

    kubectl logs -n ${namespace} ${pod_name} -c postgres

Note: By default, PostgreSQL logs within the container are typically stored in the /var/log/pg_log directory, often as .log or .csv files. The exact path and format can be influenced by the PostgreSQL configuration.