0

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.

2 Answers 2

2

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
Sign up to request clarification or add additional context in comments.

Comments

1

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

1 Comment

Thanks. I am running Ubuntu also also with PGAdminIII (3) so it was located at my /home/username/pgadmin.log'. I also had to change the postgresql.conf file as per user3118220 comments below. And also ran SHOW config_file;` as an SQL command to find the location of my postgresql.conf file. Cheers all. stackoverflow.com/questions/3602450/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.