Re: log_filename_prefix --> log_filename + strftime()

From: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: log_filename_prefix --> log_filename + strftime()
Date: 2004-08-27 21:48:21
Message-ID: 200408271548.21565.pgsql@bluepolka.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Friday August 27 2004 1:15, Tom Lane wrote:
> "Ed L." <pgsql(at)bluepolka(dot)net> writes:
> > On Friday August 27 2004 1:03, Tom Lane wrote:
> >> Hmm ... there isn't any way to emulate that with strftime escapes,
> >> unless I missed the right one.
> >
> > If you supply an escape, Apache will override that default epoch. So I
> > could see setting the default to "server_log" or "postgresql_log" or
> > whatever, and making the default (with no escapes supplied) be the
> > epoch. That would be easy tweak, and be much closer to Apache style.
>
> Yeah, and it would also prevent a risk I now see with your initial
> patch: if no %, it'll write the same filename each time, which
> is almost certainly not desired. Works for me.

I think this turns out to be no big deal either way here as it is for Apache
either way. Consider if I set my rotation time to 1 hour and my
log_filename = 'server_log.%a' (server_log.Fri). Then each of the first 22
rotations for the day will simply reopen and append to the same file.
IIRC, Apache's rotatelogs works the same way. In both cases, you just have
to be careful to coordinate your filename and rotation time/size limits to
get the desired effect.

Ed

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-08-27 21:49:26 Re: log_filename_prefix --> log_filename + strftime()
Previous Message Ed L. 2004-08-27 21:14:27 Re: log_filename_prefix --> log_filename + strftime()