Обсуждение: logging

Поиск
Список
Период
Сортировка

logging

От
"Devinder K Rajput"
Дата:
Hi all,

I am trying to setup logging.  I have updated the postgresql.conf by making
the following changes:

#debug_level = 0 # range 0-16
debug_level = 2 # range 0-16

#debug_print_query = false
debug_print_query = true
...

#       Syslog
#
#ifdef ENABLE_SYSLOG
#syslog = 0 # range 0-2
syslog = 2 # range 0-2

I have also update the postgresql script that we use to start postmaster to
redirect output to a log file rather than /dev/null.  I get the following
in the log file:

postmaster successfully started
invoking IpcMemoryCreate(size=1236992)
FindExec: found "/usr/bin/postmaster" using argv[0]
/usr/bin/postmaster: reaping dead processes...
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling writing 5
/usr/bin/postmaster: BackendStartup: pid 30039 user postgres db dioh socket
5
/usr/bin/postmaster child[30039]: starting with (postgres -d2 -v131072 -p
dioh )
FindExec: found "/usr/bin/postgres" using argv[0]
/usr/bin/postmaster: reaping dead processes...
/usr/bin/postmaster: CleanupProc: pid 30039 exited with status 0
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling writing 5
/usr/bin/postmaster: BackendStartup: pid 30054 user postgres db
counterpoint soc
ket 5
/usr/bin/postmaster child[30054]: starting with (postgres -d2 -v131072 -p
counte
rpoint )
....

I want the log file to show activity that occurs when queries are executed.
But this seems to be only showing output when I open a psql session or log
out of it.  Could you please kindly let me know what I am missing.  Thank
you.

p.s. The whole reason for turning on logging is that we are processing
sales data from about 100 locations to generate inventory numbers.  The
program runs fine for all but 1 store.  The problem is that postmaster
keeps on running for about 3 days processing something when it only should
take about 30 mintues.  I figured maybe logging will show what postmaster
is doing while it's on its 3 day cruise.


Devinder Rajput
Stores Division Corporate Offices
Chicago, IL
(773) 442-6474


Re: logging

От
Andrew Sullivan
Дата:
On Wed, Sep 25, 2002 at 09:14:36AM -0500, Devinder K Rajput wrote:
>
> #       Syslog
> #
> #ifdef ENABLE_SYSLOG
> #syslog = 0 # range 0-2
> syslog = 2 # range 0-2

You've sent the logs to syslog, although some messages go to STDERR
anyway.  If your syslog is not configured to do something with the
messages, it's probably all ending up in /path/to/system/logs/syslog
or something like that.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110