Database Reference
In-Depth Information
Log statements
The first step is to ensure that you have access to all logs in real time. The Heroku client
provides the heroku logs command that allows you to view all logs collected by the
Logplex in a unified manner. Using this command, you can filter through the postgres pro-
cess to view only database logs. You can also use the -t option (tail); this opens a continu-
ous stream of data logs. Here is an example:
$ heroku logs -p postgres -t --app your-app-name
2014-11-01T23:41:42Z app[postgres.10]: [CHARCOAL] checkpoint
complete: wrote 0 buffers (0.0%); 0 transaction log file(s)
added, 0 removed, 1 recycled; write=0.000 s, sync=0.000 s,
total=0.004 s; sync files=0, longest=0.000 s, average=0.000 s
This way, you can view the logs generated by your Postgres database, perform the diagnos-
is, and identify the common errors.
The heroku logs command provides the following options to display the recent log output:
-n, --num NUM : This refers to the number of lines to display
-p, --ps PS : This only display logs from the given process
-s, --source SOURCE : This only display logs from the given source
-t, --tail : This refers to continually streaming logs
Tip
The logs are available for production database plans. They are not available for plans in the
Hobby tier.
Search WWH ::




Custom Search