Jay Killeen
Jay Killeen

Reputation: 2922

View Rails database log in development

I can view my production database log on Heroku by running heroku logs -p postgres -t from my development machine. How can I do this to my development database?

Just trying to debug some rails commands that skip Rails and go direct to the database.

Upvotes: 0

Views: 2318

Answers (2)

user3118220
user3118220

Reputation: 1468

You would have to enable logging of all SQL executed by PostgreSQL

In your data/postgresql.conf file, change the log_statement setting to 'all'.

Error Reporting and Logging - log_statement

tail -f fil_path that will show run time updation of file, so You can check with the help of it

tail -f /usr/local/var/postgres/server.log

Upvotes: 2

monfresh
monfresh

Reputation: 8056

Assuming you're on a Mac and that you installed Postgres via Homebrew, you can view the local Postgres logs in real time on your development machine by running the following command:

tail -f /usr/local/var/postgres/server.log

Upvotes: 1

Related Questions