Skip to main content

Where to find the PostgreSQL log?

Getting Information About Database Server Runtime

Written by Petr Pech

This article applies only to server / on-premise installations of ABRA Flexi.

The PostgreSQL database server automatically writes information about its operation to the system log. This log can provide a range of insights, such as the causes of incorrect behavior. The location of the log varies depending on the operating system on which you are running Flexi.

Let's take a look at where to find the log on each operating system.

Windows

In the Start menu, select Windows Administrative Tools. Then, in the menu that appears, select Event Viewer - Windows Logs - Application.

The full path is:

Computer Management -> Event Viewer -> Windows Logs -> Application

macOS

Open the Terminal application and enter the command sudo su - and provide your password. The database log is then located at:

/Library/Application\ Support/FlexiBee/Data/pg_log/startup.log

However, the file is not accessible by default at this location, so it can be copied to another location.

The following command copies the log to your Documents folder, where it can be read and shared:

​sudo cp /Library/Application\ Support/FlexiBee/Data/pg_log/startup.log ~/Documents/ && sudo chmod 777 ~/Documents/startup.log

​Linux

Linux (DEB)

All logs are stored in the /var/log/ directory, and the PostgreSQL database server log can be found in the subdirectory /var/log/postgresql/.

For example:

/var/log/postgresql/postgresql-9.6-flexi.log

(the highlighted pgSQL version number may differ)

Linux (RPM)

The log can be found in the directory /var/lib/pgsql/pg_log/.

Did this answer your question?