logging time with queries

Поиск
Список
Период
Сортировка
От Anjan Dave
Тема logging time with queries
Дата
Msg-id 4BAFBB6B9CC46F41B2AD7D9F4BBAF785098837@vt-pe2550-001.vantage.vantage.com
обсуждение исходный текст
Список pgsql-admin

Hi,

 

I need some help on a logging situation. I am logging the stdout to a file (/var/log/pglogs) like this:

 

In Postgresql.conf:

**********************

syslog = 0                      # range 0-2; 0=stdout; 1=both; 2=syslog

syslog_facility = 'LOCAL0'

syslog_ident = 'postgres'

 

log_min_duration_statement = 4000 # Log all statements whose

                                                         # execution time exceeds the value, in

                                            # milliseconds.

log_timestamp = true

 

The init.d/postgres is changed like this:

*********************************************

PGLOG=/var/log/pglogs

export PGLOG

                $SU -l postgres -c "$PGENGINE/initdb --pgdata=$PGDATA" >> $PGLOG 2>&1 < /dev/null

        $SU -l postgres -c "$PGENGINE/postmaster -p ${PGPORT} -D '${PGDATA}' ${PGOPTS} &" >> $PGLOG 2>&1 < /dev/null

 

With this setup, I can capture some queries that take more than 4 seconds to execute, but I am not seeing any time stamps on any logging, except database startup/shutdown events, which makes it difficult to track certain activities.

 

Is there a way to log time as well?

 

Thanks,
Anjan

 
 
******************************************************************************************
This e-mail and any files transmitted with it are intended for the use of the 
addressee(s) only and may be confidential and covered by the attorney/client 
and other privileges.  If you received this e-mail in error, please notify the 
sender; do not disclose, copy, distribute, or take any action in reliance on 
the contents of this information; and delete it from your system. Any other 
use of this e-mail is prohibited.
******************************************************************************************

 

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Rajesh Murthy"
Дата:
Сообщение: unsubscribe
Следующее
От: "Cory Vokey"
Дата:
Сообщение: Lingering Checkpoint Process