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.

Jay Killeen
  • 2,832
  • 6
  • 39
  • 66

2 Answers2

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
user3118220
  • 1,438
  • 12
  • 16
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
monfresh
  • 7,974
  • 1
  • 25
  • 22
  • 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. http://stackoverflow.com/questions/3602450/where-are-my-postgres-conf-files – Jay Killeen Mar 24 '15 at 05:14