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: 4BAFBB6B9CC46F41B2AD7D9F4BBAF785098837@vt-pe2550-001.vantage.vantage.com (view raw or flat)
Thread:
Lists: 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 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-2014 The PostgreSQL Global Development Group