Re: log_collector & sysout on windows - Mailing list pgsql-general

From Marc Brazeau
Subject Re: log_collector & sysout on windows
Date
Msg-id CAKuZ-AgTf87z1fvesbUNUs+P_CCHC7CbBvz1jqg=twa9uaqCpg@mail.gmail.com
Whole thread Raw
In response to log_collector & sysout on windows  (Marc Brazeau <litespeedmarc@gmail.com>)
List pgsql-general
I think I figured this out after some playing around.

Looks like postgres only redirects stderr to its log files.  Consistent with what documentation says, and my findings playing around.

In my situation, I was looking for sysout of my python archiver to go to postgres log files.

I added sys.stdout = sys.stderr at the start of entry python script, and all was well after that.


On Wed, May 28, 2014 at 1:30 PM, Marc Brazeau <litespeedmarc@gmail.com> wrote:
So I'm sure I'm doing something wrong, or this is maybe a novice question,

On My Mac, I set log_collector=on, archive_command='echo hello %p %f'
And awesome, my postgres log files get the output from my archive command.

On Windows, this does not work (Using postgres 9.3..4)

Only way to get output from my archive_command, is with the -l option on pg_ctl start.  But this has issues:
- Not sure it will work with Services (thoughI haven't tried).
- I don't get any of the log_rotation
- And I lose context (from having sysouts along side other Postgres message).

Surely there is a simple answer here?

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Is it typo in pg_stat_replication column name in PG 9.4 ?
Next
From: rob stone
Date:
Subject: Re: Postgresql 9.2.4 - timezone error