Re: syslogger line-end processing infelicity - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: syslogger line-end processing infelicity
Date
Msg-id 466098AD.9010603@dunslane.net
Whole thread Raw
In response to Re: syslogger line-end processing infelicity  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: syslogger line-end processing infelicity  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.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.

cheers

andrew





pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Constraint exclusion oddity with composite index
Next
From: Zdenek Kotala
Date:
Subject: Re: Command tags in create/drop scripts