Re: Unwanted debug messages

Поиск
Список
Период
Сортировка
От Joe Abbate
Тема Re: Unwanted debug messages
Дата
Msg-id 52011FE8.9040100@freedomcircle.com
обсуждение исходный текст
Ответ на Re: Unwanted debug messages  (Wenceslao Grillo <wenceslao@leandergames.com>)
Ответы Re: Unwanted debug messages  (Wenceslao Grillo <wenceslao@leandergames.com>)
Re: Unwanted debug messages  (Adrian Klaver <adrian.klaver@gmail.com>)
Список psycopg
Wences,

On 06/08/13 10:35, Wenceslao Grillo wrote:
> I don't think it's such an unusual setup: One box is running PostgreSQL
> and my Python script is in another box, connecting to it (and getting
> all the unwanted messages). Because right now I'm using a development
> postgres box, I can log in to it and use psql but then I don't get those
> messages. The messages show up on my screen, on my terminal when I run
> my Python script. And I know that the debug messages are going to stderr
> because if I say:
>     ./my_script.py 2>/dev/null
> I get all the prints that I put in my code and none of the debug
> messages. But I miss the messages from uncaught exceptions and the like,
> that also go to stderr.

I'm afraid there's still something different in your environment.  I
edited my postgresql.conf to change log_min_messages to debug3,
restarted it and then ran the following:

$ cat test.py
import sys
import psycopg2
conn = psycopg2.connect(database="jma")
if conn is None:
    sys.exit("Connection failed")
print "Connection successful"
$ python test.py
Connection successful

The debug messages end up in
/var/log/postgresql/postgresql-9.1-main.log, e.g.,

2013-08-06 11:56:14 EDT DEBUG:  CommitTransaction
2013-08-06 11:56:14 EDT DEBUG:  name: unnamed; blockState:
STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
2013-08-06 11:56:14 EDT DEBUG:  shmem_exit(0): 8 callbacks to make
2013-08-06 11:56:14 EDT DEBUG:  proc_exit(0): 2 callbacks to make
2013-08-06 11:56:14 EDT DEBUG:  exit(0)

but never in my front-end process.  I believe that would only happen if
I had started postgres from the command line, i.e., invoking the
'postgres' executable directly instead of using pg_ctl to start it in
the background (or as a service on Windows).

Saludos,

Joe


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

Предыдущее
От: Wenceslao Grillo
Дата:
Сообщение: Re: Unwanted debug messages
Следующее
От: Wenceslao Grillo
Дата:
Сообщение: Re: Unwanted debug messages