Where are the postgres logs?
Jun 10
I'm using DBeaver to connect the postgres db and want to access the logs via DBeaver.
I run the command below to find log destination and got stderr as the location.
show log_destination ;
How can I reach that file on DB app? FYI, I want all logs, not the logs that are from DBeaver.
1 answer
Accepted answer · original discussion
Jun 10
On recent PostgreSQL versions, that is simple:
SELECT pg_current_logfile();
If the result is a relative path, it is relative to the data directory, which you can identify with SHOW data_directory;.
For old versions, proceed as follows:
Verify that the logging collector is started:
SHOW logging_collector;If not, the location of the log depends on how PostgreSQL was started.
If yes, the log will be in
log_directory:SHOW log_directory;Again, if that is a relative path, it is relative to the PostgreSQL data directory.
Since the log file is on the database server, you probably won't be able to access it with a client tool.
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.