select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / SYSTEM INFORMATION FUNCTIONS AND OPERATORS

pg_current_logfile

Read PG 18 manual ↗

Returns the path name of the log file currently in use by the logging collector.

Signatures & examples

pg_current_logfile ( [ text ] ) → text
Returns the path name of the log file currently in use by the logging collector. The path includes the log_directory directory and the individual log file name. The result is NULL if the logging collector is disabled. When multiple log files exist, each in a different format, pg_current_logfile without an argument returns the path of the file having the first format found in the ordered list: stderr, csvlog, jsonlog. NULL is returned if no log file has any of these formats. To request information about a specific log file format, supply either csvlog, jsonlog or stderr as the value of the optional parameter. The result is NULL if the log format requested is not configured in log_destination. The result reflects the contents of the current_logfiles file.
Version history 3
  1. PG 14 → 15changed
  2. PG 12 → 13changed
  3. PG 9.6 → 10added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source