Skip site navigation (1) Skip section navigation (2)

logging time with queries

From: "Anjan Dave" <adave(at)vantage(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: logging time with queries
Date: 2005-02-23 16:19:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin


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:



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?



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
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
use of this e-mail is prohibited.


pgsql-admin by date

Next:From: Cory VokeyDate: 2005-02-23 16:28:25
Subject: Lingering Checkpoint Process
Previous:From: Rajesh MurthyDate: 2005-02-23 16:01:23
Subject: unsubscribe

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group