Re: log_filename_prefix --> log_filename + strftime()

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: log_filename_prefix --> log_filename + strftime()
Date: 2004-08-27 18:53:32
Message-ID: 412F832C.9050200@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:

>"Ed L." <pgsql(at)bluepolka(dot)net> writes:
>
>
>>On Friday August 27 2004 12:08, Tom Lane wrote:
>>
>>
>>>[ justification please ]
>>>
>>>
>
>
>
>>Yes, should have said more on that item. First, I didn't see how to easily
>>make it configurable in combination with strftime() without doing more
>>work, and it didn't appear to be worth the effort. By its addition,
>>hard-coding the PID into the filename deviates from what I would argue is
>>the de facto standard of Apache's rotatelogs and forces a naming convention
>>where none existed before. That creates work for us as we have a
>>considerable infrastructure setup to deal with logs; I suspect that may be
>>the case with others. I looked, but did not find, justification for why it
>>was introduced; I would assume it was added to allow for multiple
>>postmasters sharing the same log directory. I had difficulty fathoming the
>>usefulness of this being hard-coded, as it seems one could compensate
>>easily through the configurable 'log_filename' if one chose to share a log
>>directory among postmasters. Not by including the PID, but by some other
>>postmaster-unique naming approach. Given its a new 'feature', I'm hoping
>>it can be altered to return the freedom of filenaming to the administrator.
>>
>>
>
>Or you could use different log_directory settings for different PMs.
>Fair enough.
>
>Anyone else have an opinion pro or con about this change? IMHO it's in
>the gray area between bug fix and feature addition. If we want to do
>it, though, doing it now is certainly better than holding it for 8.1,
>since by then people would have gotten used to the present behavior.
>
>BTW, as long as we are taking Apache as the de facto standard --- does
>the default of "postgresql-%Y-%m-%d_%H%M%S.log" actually make sense, or
>would something different be closer to the common practice with Apache?
>
>
>
>

If the PID isn't there is there a danger of different postmasters
clobbering each other's logs? ISTM having the PID there gives some sort
of guarantee that that won't happen. I don't have any strong opinion one
way or another, but I wondered if a configurable strings with % escapes
like we use for log_line_prefix might be better. It could be argued to
be overkill, I guess. Alternatively, we could have a different boolean
option 'log_filename_use_pid' or some such.

cheers

andrew

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Ed L. 2004-08-27 18:53:36 Re: log_filename_prefix --> log_filename + strftime()
Previous Message Ed L. 2004-08-27 18:51:50 Re: log_filename_prefix --> log_filename + strftime()