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

Re: syslogger line-end processing infelicity

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: syslogger line-end processing infelicity
Date: 2007-06-01 22:07:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> I have been looking at the syslogger code in connection with the CSV log 
>> output proposal, and I'm quite concerned about the way it translates 
>> every \n into \r\n for Windows output.
>> ...
>> My second thought is that we should quite possibly abandon this 
>> translation altogether
> +1 on that.  The problem of ensuring atomic output remains though
> (see nearby complaints from George Pavlov and others).  It's bad enough
> in the existing logging context, but if we're hoping to make
> easily-machine-readable logs it's a "must fix".

Is that the one you suggested trying to fix by calling write() instead 
of fprintf()? If so, I can't think of any good reason not to do that 
anyway. (I assume we're not worried about the use of vfprintf(stderr, 
...) in write_stderr().)

That really means we have two problems: log lines can be interleaved, 
and rotation can cause a line to be split over two files. Triple ugh.



In response to


pgsql-hackers by date

Next:From: Zdenek KotalaDate: 2007-06-01 22:20:06
Subject: Re: Command tags in create/drop scripts
Previous:From: Ed L.Date: 2007-06-01 22:07:25
Subject: Re: query log corrupted-looking entries

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