Configuring PostgreSQL to use with pgFouine
-------------------------------------------

pgFouine reads PostgreSQL logs to generate its reports. You therefore
need to enable query logging in PostgreSQL. The currently recommended
method is to do this through syslog.

You need to edit your postgresql.conf file (usually,
/etc/postgresql/8.1/main/postgresql.conf) and set the following values:

log_destination = 'syslog'
redirect_stderr = off
silent_mode = on
log_min_duration_statement = n
log_duration = off
log_statement = 'none'

Where "n" is a number of milliseconds. Any query taking more that n
milliseconds will be logged. If n is 0, all queries will be logged. If n
is -1, no query will be logged.

You then need to edit your syslog configuration file to redirect
postgresql log information to a file.

If you use sysklogd, just add the following line to /etc/syslog.conf:

local0.*		-/var/log/pgsql

It is also recommended to add ";local0.none" to the "/var/log/messages"
line, to avoid duplicate logging.


If you use syslog-ng, you could use the following configuration:

destination df_pg { file("/var/log/postgres.log"); };
filter f_pg { facility( local0 ); };
log {
	source(s_all);
	filter(f_pg);
	destination( df_pg );
};

Note that the syslog facility can be changed in postgreSQL configuration
file.

Generating VACUUM reports
-------------------------

pgFouine can generate VACUUM reports to help you improve your vacuuming
strategy. To do this, get the output of the "vacuum verbose analyze"
command, and run:
pgfouine_vacuum -file your_vacuum_log > vacuum.html

Configuring PHP for generation of graphs
----------------------------------------

pgFouine uses the GD2 library to draw graphs. You need to enable it in
PHP configuration has this is not done automatically.

As root, edit the /etc/php5/cli/php.ini file and uncomment the
";extension=gd.so" line by removing the leading ";".
