Re: log_line_info

Lists: pgsql-hackerspgsql-patches
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: log_line_info
Date: 2004-02-29 18:09:45
Message-ID: 40422AE9.7030009@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


I think this is now ready for application, unless someone objects.

Since the last patch I posted, I have done the following:

. changed the escapes to lower case, as Peter prefers. This is also in
line with what Apache does, which is the nearest equivalent I can think of.
. added 2 new escapes: %r = remote host and port and %x says "postmaster
and friends stop here". Postmaster and friends will also ignore any
escapes they see that don't make sense (specifically %u %d %i %r %s and
%c). However, they no longer ignore the whole facility. This means we
can use it for logging (for example) timestamps and pids in all cases.
. added docco
. changed source port reporting from host:port to host(port) to avoid
IP6 address ambiguity.

If someone wants to monkey with the name of the facility, it shouldn't
be hard. I don't like plain "log_line", though. "log_line_prefix" or
"log_line_tag" both seem to me better alternatives.

After this is applied (fingers crossed) and everyone is happy, I will
submit a patch to remove log_timestamp, log_pid and (if we are agreed on
it) log_source_port.

cheers

andrew

Attachment Content-Type Size
info.patch text/plain 16.4 KB

From: Jon Jensen <jon(at)endpoint(dot)com>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: log_line_info
Date: 2004-03-01 21:38:37
Message-ID: Pine.LNX.4.58.0403012127230.12165@louche.swelter.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Sun, 29 Feb 2004, Andrew Dunstan wrote:

> . changed source port reporting from host:port to host(port) to avoid
> IP6 address ambiguity.

I have no idea how widespread this is, but recent versions of BIND write
it this way:

127.0.0.1#953
::1#953

Personally I'd kind of like to see host:port for IPv4 (for familiarity)
and host#port for IPv6 (for clarity), but I don't know that it's worth
spending much time on.

Excellent patch, though.

Jon


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: log_line_info
Date: 2004-03-02 01:32:43
Message-ID: 4043E43B.2020905@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Jon Jensen wrote:

>On Sun, 29 Feb 2004, Andrew Dunstan wrote:
>
>
>
>>. changed source port reporting from host:port to host(port) to avoid
>>IP6 address ambiguity.
>>
>>
>
>I have no idea how widespread this is, but recent versions of BIND write
>it this way:
>
>127.0.0.1#953
>::1#953
>
>Personally I'd kind of like to see host:port for IPv4 (for familiarity)
>and host#port for IPv6 (for clarity), but I don't know that it's worth
>spending much time on.
>

host might be a name instead of an address (if you have log_host_name
turned on), so I'm not inclined to distinguish between address families.
Altering the format used would be a 2 line change. (I hope the patch
isn't held up over that issue).

>
>Excellent patch, though.
>

thanks

cheers

andrew


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: log_line_info
Date: 2004-03-09 04:40:39
Message-ID: 200403090440.i294edo24833@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
>
> I think this is now ready for application, unless someone objects.
>
> Since the last patch I posted, I have done the following:
>
> . changed the escapes to lower case, as Peter prefers. This is also in
> line with what Apache does, which is the nearest equivalent I can think of.
> . added 2 new escapes: %r = remote host and port and %x says "postmaster
> and friends stop here". Postmaster and friends will also ignore any
> escapes they see that don't make sense (specifically %u %d %i %r %s and
> %c). However, they no longer ignore the whole facility. This means we
> can use it for logging (for example) timestamps and pids in all cases.
> . added docco
> . changed source port reporting from host:port to host(port) to avoid
> IP6 address ambiguity.
>
> If someone wants to monkey with the name of the facility, it shouldn't
> be hard. I don't like plain "log_line", though. "log_line_prefix" or
> "log_line_tag" both seem to me better alternatives.
>
> After this is applied (fingers crossed) and everyone is happy, I will
> submit a patch to remove log_timestamp, log_pid and (if we are agreed on
> it) log_source_port.

I have applied this patch. It will be a great addition to PostgreSQL.

I made a few modifications. I reordered the options in the docs and
postgresql.conf, e.g.:

+ #log_line_prefix = '' # e.g. '<%u%%%d> '
+ # %u=user name %d=database name
+ # %r=remote host and port
+ # %p=PID %t=timestamp %i=command tag
+ # %c=session id %l=session line number
+ # %s=session start timestamp
+ # %x=stop here in non-session processes
+ # %%='%'

I also changed:

*** src/include/miscadmin.h 10 Feb 2004 03:42:45 -0000 1.153
--- src/include/miscadmin.h 29 Feb 2004 17:49:07 -0000
***************
*** 24,29 ****
--- 24,31 ----
#define MISCADMIN_H


+ #include "libpq/libpq-be.h"

(wouldn't compile) to:

*** src/backend/utils/misc/ps_status.c 22 Feb 2004 21:26:55 -0000
1.17
--- src/backend/utils/misc/ps_status.c 9 Mar 2004 04:33:35 -0000
***************
*** 26,31 ****
--- 26,32 ----
#include <crt_externs.h>
#endif

+ #include "libpq/libpq.h"
#include "miscadmin.h"
#include "utils/ps_status.h"

for use of "Port".

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 16.6 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: log_line_info
Date: 2004-03-09 04:46:05
Message-ID: 200403090446.i294k5G28367@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Oh, I also renamed it to "log_line_prefix", which was one of your
suggestions. And I also updated some of the documentation phrasing.

I also marked the TODO item as completed.

Thanks.

---------------------------------------------------------------------------

Andrew Dunstan wrote:
>
> I think this is now ready for application, unless someone objects.
>
> Since the last patch I posted, I have done the following:
>
> . changed the escapes to lower case, as Peter prefers. This is also in
> line with what Apache does, which is the nearest equivalent I can think of.
> . added 2 new escapes: %r = remote host and port and %x says "postmaster
> and friends stop here". Postmaster and friends will also ignore any
> escapes they see that don't make sense (specifically %u %d %i %r %s and
> %c). However, they no longer ignore the whole facility. This means we
> can use it for logging (for example) timestamps and pids in all cases.
> . added docco
> . changed source port reporting from host:port to host(port) to avoid
> IP6 address ambiguity.
>
> If someone wants to monkey with the name of the facility, it shouldn't
> be hard. I don't like plain "log_line", though. "log_line_prefix" or
> "log_line_tag" both seem to me better alternatives.
>
> After this is applied (fingers crossed) and everyone is happy, I will
> submit a patch to remove log_timestamp, log_pid and (if we are agreed on
> it) log_source_port.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-09 15:02:14
Message-ID: 404DDC76.8020307@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

>Andrew Dunstan wrote:
>
>
>>After this is applied (fingers crossed) and everyone is happy, I will
>>submit a patch to remove log_timestamp, log_pid and (if we are agreed on
>>it) log_source_port.
>>
>>
>
>I have applied this patch. It will be a great addition to PostgreSQL.
>
>
>

Is there agreement on removing these 3 config vars?

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-09 16:01:11
Message-ID: 25641.1078848071@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> After this is applied (fingers crossed) and everyone is happy, I will
>>> submit a patch to remove log_timestamp, log_pid and (if we are agreed on
>>> it) log_source_port.

> Is there agreement on removing these 3 config vars?

Now that I look at it, log_source_port does look pretty useless.
While you are at it, please clean up the confusion about whether
port->remote_host contains the port number or not (IMHO it should never
do so; BackendInit() is doing things in the wrong order).

regards, tom lane


From: Rod Taylor <pg(at)rbt(dot)ca>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-09 16:38:17
Message-ID: 1078847515.86715.0.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> >>After this is applied (fingers crossed) and everyone is happy, I will
> >>submit a patch to remove log_timestamp, log_pid and (if we are agreed on
> >>it) log_source_port.

> Is there agreement on removing these 3 config vars?

There is from me.


From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-10 10:54:09
Message-ID: umst409mdn1t57qdp3o0kv3s236qhnobgt@email.aon.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Tue, 09 Mar 2004 10:02:14 -0500, Andrew Dunstan <andrew(at)dunslane(dot)net>
wrote:
>>>After this is applied (fingers crossed) and everyone is happy, I will
>>>submit a patch to remove log_timestamp, log_pid and (if we are agreed on
>>>it) log_source_port.

>Is there agreement on removing these 3 config vars?

Please don't. Declare them obsolete for 7.5 and remove them in a later
release.

Servus
Manfred


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-10 12:06:36
Message-ID: 20040310200606.V59823-100000@houston.familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> Please don't. Declare them obsolete for 7.5 and remove them in a later
> release.

Nah, just remove them. We've removed, added and changed so many config
options and no-one's ever complained...

Chris


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Manfred Koizar <mkoi-pg(at)aon(dot)at>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-10 16:00:39
Message-ID: 7045.1078934439@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
>> Please don't. Declare them obsolete for 7.5 and remove them in a later
>> release.

> Nah, just remove them. We've removed, added and changed so many config
> options and no-one's ever complained...

I agree with Chris; this would be taking compatibility concerns a bit
far. None of these variables are likely to be touched except through
postgresql.conf (I don't think we even allow them to be SET interactively).
And you can never simply take your old .conf file and plop it down into
a new release.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-10 16:14:14
Message-ID: 404F3ED6.8040406@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:

>I agree with Chris; this would be taking compatibility concerns a bit
>far. None of these variables are likely to be touched except through
>postgresql.conf (I don't think we even allow them to be SET interactively).
>And you can never simply take your old .conf file and plop it down into
>a new release.
>
>
>

Also, I selfishly want to get this out of my hair and move on :-)

The docs already state that log_source_port is useless.

patch forthcoming soon.

cheers

andrew


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Manfred Koizar <mkoi-pg(at)aon(dot)at>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log_line_info
Date: 2004-03-10 16:57:52
Message-ID: 200403101657.i2AGvqw18456@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
> >> Please don't. Declare them obsolete for 7.5 and remove them in a later
> >> release.
>
> > Nah, just remove them. We've removed, added and changed so many config
> > options and no-one's ever complained...
>
> I agree with Chris; this would be taking compatibility concerns a bit
> far. None of these variables are likely to be touched except through
> postgresql.conf (I don't think we even allow them to be SET interactively).
> And you can never simply take your old .conf file and plop it down into
> a new release.

And the other reason to remove them is that if you don't, you will get
all sorts of confusion about people asking, "Which one should I use for
pid logging? Looks like both work."

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: remove log_timestamp, log_pid and log_source_port GUC vars
Date: 2004-03-10 17:49:10
Message-ID: 404F5516.7010906@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

>Tom Lane wrote:
>
>
>>Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
>>
>>
>>>>Please don't. Declare them obsolete for 7.5 and remove them in a later
>>>>release.
>>>>
>>>>
>>>Nah, just remove them. We've removed, added and changed so many config
>>>options and no-one's ever complained...
>>>
>>>
>>I agree with Chris; this would be taking compatibility concerns a bit
>>far. None of these variables are likely to be touched except through
>>postgresql.conf (I don't think we even allow them to be SET interactively).
>>And you can never simply take your old .conf file and plop it down into
>>a new release.
>>
>>
>
>And the other reason to remove them is that if you don't, you will get
>all sorts of confusion about people asking, "Which one should I use for
>pid logging? Looks like both work."
>
>
>
OK, Here's the patch. Also makes some minor improvements in the docco
for log_line_prefix.

cheers

andrew

Attachment Content-Type Size
log.patch text/plain 14.5 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: remove log_timestamp, log_pid and log_source_port GUC
Date: 2004-03-15 15:58:21
Message-ID: 200403151558.i2FFwL922667@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

Andrew Dunstan wrote:
> Bruce Momjian wrote:
>
> >Tom Lane wrote:
> >
> >
> >>Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
> >>
> >>
> >>>>Please don't. Declare them obsolete for 7.5 and remove them in a later
> >>>>release.
> >>>>
> >>>>
> >>>Nah, just remove them. We've removed, added and changed so many config
> >>>options and no-one's ever complained...
> >>>
> >>>
> >>I agree with Chris; this would be taking compatibility concerns a bit
> >>far. None of these variables are likely to be touched except through
> >>postgresql.conf (I don't think we even allow them to be SET interactively).
> >>And you can never simply take your old .conf file and plop it down into
> >>a new release.
> >>
> >>
> >
> >And the other reason to remove them is that if you don't, you will get
> >all sorts of confusion about people asking, "Which one should I use for
> >pid logging? Looks like both work."
> >
> >
> >
> OK, Here's the patch. Also makes some minor improvements in the docco
> for log_line_prefix.
>
> cheers
>
> andrew

> Index: doc/src/sgml/runtime.sgml
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/runtime.sgml,v
> retrieving revision 1.248
> diff -c -r1.248 runtime.sgml
> *** doc/src/sgml/runtime.sgml 9 Mar 2004 23:15:47 -0000 1.248
> --- doc/src/sgml/runtime.sgml 10 Mar 2004 16:07:46 -0000
> ***************
> *** 1993,1999 ****
> <para>
> Causes the duration of every completed statement to be logged.
> To use this option, it is recommended that you also enable
> ! <varname>log_statement</> and <varname>log_pid</> so that you
> can link the statement to the duration using the process
> ID. The default is off. Only superusers can turn off this
> option if it is enabled by the administrator.
> --- 1993,2000 ----
> <para>
> Causes the duration of every completed statement to be logged.
> To use this option, it is recommended that you also enable
> ! <varname>log_statement</> and if not using <application>syslog</>
> ! log the PID using <varname>log_line_prefix</> so that you
> can link the statement to the duration using the process
> ID. The default is off. Only superusers can turn off this
> option if it is enabled by the administrator.
> ***************
> *** 2014,2019 ****
> --- 2015,2022 ----
> processes without controlling sessions. <application>Syslog</> produces its own
> timestamp and process ID information, so you probably do not want to
> use those escapes if you are using <application>syslog</>.
> + This option can only be set at server start or in the
> + <filename>postgresql.conf</filename> configuration file.
> <informaltable>
> <tgroup cols="3">
> <thead>
> ***************
> *** 2058,2064 ****
> <row>
> <entry><literal>%c</literal></entry>
> <entry>Session ID. A unique identifier for each session.
> ! It is 2 4-byte hexadecimal numbers separated by a dot. The numbers
> are the Session Start Time and the Process ID, so this can also
> be used as a space saving way of printing these items.</entry>
> <entry>Yes</entry>
> --- 2061,2068 ----
> <row>
> <entry><literal>%c</literal></entry>
> <entry>Session ID. A unique identifier for each session.
> ! It is 2 4-byte hexadecimal numbers (without leading zeros)
> ! separated by a dot. The numbers
> are the Session Start Time and the Process ID, so this can also
> be used as a space saving way of printing these items.</entry>
> <entry>Yes</entry>
> ***************
> *** 2093,2111 ****
> </listitem>
> </varlistentry>
>
> - <varlistentry>
> - <term><varname>log_pid</varname> (<type>boolean</type>)</term>
> - <listitem>
> - <para>
> - Prefixes each message in the server log file with the process ID of
> - the server process. This is useful to sort out which messages
> - pertain to which connection. The default is off. This parameter
> - does not affect messages logged via <application>syslog</>, which
> - always contain the process ID.
> - </para>
> - </listitem>
> - </varlistentry>
> -
> <varlistentry id="guc-log-statement" xreflabel="log_statement">
> <term><varname>log_statement</varname> (<type>boolean</type>)</term>
> <listitem>
> --- 2097,2102 ----
> ***************
> *** 2120,2135 ****
> </listitem>
> </varlistentry>
>
> - <varlistentry id="guc-log-timestamp" xreflabel="log_timestamp">
> - <term><varname>log_timestamp</varname> (<type>boolean</type>)</term>
> - <listitem>
> - <para>
> - Prefixes each server log message with a time stamp. The default
> - is off.
> - </para>
> - </listitem>
> - </varlistentry>
> -
> <varlistentry id="guc-log-hostname" xreflabel="log_hostname">
> <term><varname>log_hostname</varname> (<type>boolean</type>)</term>
> <listitem>
> --- 2111,2116 ----
> ***************
> *** 2143,2161 ****
> </listitem>
> </varlistentry>
>
> - <varlistentry id="guc-log-source-port" xreflabel="log_source_port">
> - <term><varname>log_source_port</varname> (<type>boolean</type>)</term>
> - <listitem>
> - <para>
> - Shows the outgoing port number of the connecting host in the
> - connection log messages. You could trace back the port number
> - to find out what user initiated the connection. Other than
> - that, it's pretty useless and therefore off by default. This
> - option can only be set at server start.
> - </para>
> - </listitem>
> - </varlistentry>
> -
> </variablelist>
> </sect3>
> </sect2>
> --- 2124,2129 ----
> Index: src/backend/postmaster/postmaster.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v
> retrieving revision 1.372
> diff -c -r1.372 postmaster.c
> *** src/backend/postmaster/postmaster.c 9 Mar 2004 05:11:52 -0000 1.372
> --- src/backend/postmaster/postmaster.c 10 Mar 2004 16:07:46 -0000
> ***************
> *** 212,219 ****
> int CheckPointWarning = 30;
> time_t LastSignalledCheckpoint = 0;
>
> ! bool log_hostname; /* for ps display */
> ! bool LogSourcePort;
> bool Log_connections = false;
> bool Db_user_namespace = false;
>
> --- 212,218 ----
> int CheckPointWarning = 30;
> time_t LastSignalledCheckpoint = 0;
>
> ! bool log_hostname; /* for ps display and logging */
> bool Log_connections = false;
> bool Db_user_namespace = false;
>
> ***************
> *** 2419,2424 ****
> --- 2418,2424 ----
> struct timezone tz;
> char remote_host[NI_MAXHOST];
> char remote_port[NI_MAXSERV];
> + char remote_ps_data[NI_MAXHOST];
>
> IsUnderPostmaster = true; /* we are a postmaster subprocess now */
>
> ***************
> *** 2479,2499 ****
> remote_port, sizeof(remote_port),
> NI_NUMERICHOST | NI_NUMERICSERV);
> }
>
> if (Log_connections)
> ereport(LOG,
> (errmsg("connection received: host=%s port=%s",
> remote_host, remote_port)));
>
> - if (LogSourcePort)
> - {
> - /* modify remote_host for use in ps status */
> - char tmphost[NI_MAXHOST];
> -
> - snprintf(tmphost, sizeof(tmphost), "%s(%s)", remote_host, remote_port);
> - StrNCpy(remote_host, tmphost, sizeof(remote_host));
> - }
> -
> /*
> * save remote_host and remote_port in port stucture
> */
> --- 2479,2493 ----
> remote_port, sizeof(remote_port),
> NI_NUMERICHOST | NI_NUMERICSERV);
> }
> + snprintf(remote_ps_data, sizeof(remote_ps_data),
> + remote_port[0] == '\0' ? "%s" : "%s(%s)",
> + remote_host, remote_port);
>
> if (Log_connections)
> ereport(LOG,
> (errmsg("connection received: host=%s port=%s",
> remote_host, remote_port)));
>
> /*
> * save remote_host and remote_port in port stucture
> */
> ***************
> *** 2522,2528 ****
> * title for ps. It's good to do this as early as possible in
> * startup.
> */
> ! init_ps_display(port->user_name, port->database_name, remote_host);
> set_ps_display("authentication");
>
> /*
> --- 2516,2522 ----
> * title for ps. It's good to do this as early as possible in
> * startup.
> */
> ! init_ps_display(port->user_name, port->database_name, remote_ps_data);
> set_ps_display("authentication");
>
> /*
> Index: src/backend/tcop/postgres.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/backend/tcop/postgres.c,v
> retrieving revision 1.394
> diff -c -r1.394 postgres.c
> *** src/backend/tcop/postgres.c 9 Mar 2004 04:43:07 -0000 1.394
> --- src/backend/tcop/postgres.c 10 Mar 2004 16:07:47 -0000
> ***************
> *** 3212,3222 ****
> snprintf(dbname, sizeof(dbname)," database=%s",port->database_name);
> snprintf(remote_host,sizeof(remote_host)," host=%s",
> port->remote_host);
> ! /* prevent redundant or empty reporting of port */
> ! if (!LogSourcePort && strlen(port->remote_port))
> ! snprintf(remote_port,sizeof(remote_port)," port=%s",port->remote_port);
> ! else
> ! remote_port[0] = '\0';
>
>
> gettimeofday(&end,NULL);
> --- 3212,3218 ----
> snprintf(dbname, sizeof(dbname)," database=%s",port->database_name);
> snprintf(remote_host,sizeof(remote_host)," host=%s",
> port->remote_host);
> ! snprintf(remote_port,sizeof(remote_port)," port=%s",port->remote_port);
>
>
> gettimeofday(&end,NULL);
> Index: src/backend/utils/error/elog.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/error/elog.c,v
> retrieving revision 1.127
> diff -c -r1.127 elog.c
> *** src/backend/utils/error/elog.c 9 Mar 2004 04:43:07 -0000 1.127
> --- src/backend/utils/error/elog.c 10 Mar 2004 16:07:47 -0000
> ***************
> *** 69,77 ****
>
> /* GUC parameters */
> PGErrorVerbosity Log_error_verbosity = PGERROR_VERBOSE;
> - bool Log_timestamp = false; /* show timestamps in stderr
> - * output */
> - bool Log_pid = false; /* show PIDs in stderr output */
> char *Log_line_prefix = ""; /* format for extra log line info */
>
> #ifdef HAVE_SYSLOG
> --- 69,74 ----
> ***************
> *** 144,151 ****
> static char *expand_fmt_string(const char *fmt, ErrorData *edata);
> static const char *useful_strerror(int errnum);
> static const char *error_severity(int elevel);
> - static const char *print_timestamp(void);
> - static const char *print_pid(void);
> static void append_with_tabs(StringInfo buf, const char *str);
> static const char *log_line_prefix(void);
>
> --- 141,146 ----
> ***************
> *** 1134,1140 ****
> case 'r':
> j += snprintf(result+j,result_len-j,"%s",
> MyProcPort->remote_host);
> ! if (!LogSourcePort && strlen(MyProcPort->remote_port))
> j += snprintf(result+j,result_len-j,"(%s)",
> MyProcPort->remote_port);
> break;
> --- 1129,1135 ----
> case 'r':
> j += snprintf(result+j,result_len-j,"%s",
> MyProcPort->remote_host);
> ! if (strlen(MyProcPort->remote_port) > 0)
> j += snprintf(result+j,result_len-j,"(%s)",
> MyProcPort->remote_port);
> break;
> ***************
> *** 1293,1302 ****
> * Timestamp and PID are only used for stderr output --- we assume
> * the syslog daemon will supply them for us in the other case.
> */
> ! fprintf(stderr, "%s%s%s",
> ! Log_timestamp ? print_timestamp() : "",
> ! Log_pid ? print_pid() : "",
> ! buf.data);
> }
>
> pfree(buf.data);
> --- 1288,1294 ----
> * Timestamp and PID are only used for stderr output --- we assume
> * the syslog daemon will supply them for us in the other case.
> */
> ! fprintf(stderr, "%s",buf.data);
> }
>
> pfree(buf.data);
> ***************
> *** 1567,1609 ****
> return prefix;
> }
>
> -
> - /*
> - * Return a timestamp string like
> - *
> - * "2000-06-04 13:12:03 "
> - */
> - static const char *
> - print_timestamp(void)
> - {
> - time_t curtime;
> - static char buf[21]; /* format `YYYY-MM-DD HH:MM:SS ' */
> -
> - curtime = time(NULL);
> -
> - strftime(buf, sizeof(buf),
> - "%Y-%m-%d %H:%M:%S ",
> - localtime(&curtime));
> -
> - return buf;
> - }
> -
> -
> - /*
> - * Return a string like
> - *
> - * "[123456] "
> - *
> - * with the current pid.
> - */
> - static const char *
> - print_pid(void)
> - {
> - static char buf[10]; /* allow `[123456] ' */
> -
> - snprintf(buf, sizeof(buf), "[%d] ", (int) MyProcPid);
> - return buf;
> - }
>
> /*
> * append_with_tabs
> --- 1559,1564 ----
> Index: src/backend/utils/misc/guc.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/misc/guc.c,v
> retrieving revision 1.189
> diff -c -r1.189 guc.c
> *** src/backend/utils/misc/guc.c 9 Mar 2004 04:43:07 -0000 1.189
> --- src/backend/utils/misc/guc.c 10 Mar 2004 16:07:49 -0000
> ***************
> *** 508,529 ****
> &Log_disconnections,
> false, NULL, NULL
> },
> - {
> - {"log_timestamp", PGC_SIGHUP, LOGGING_WHAT,
> - gettext_noop("Prefixes server log messages with a time stamp."),
> - NULL
> - },
> - &Log_timestamp,
> - false, NULL, NULL
> - },
> - {
> - {"log_pid", PGC_SIGHUP, LOGGING_WHAT,
> - gettext_noop("Prefixes server log messages with the server PID."),
> - NULL
> - },
> - &Log_pid,
> - false, NULL, NULL
> - },
>
> #ifdef USE_ASSERT_CHECKING
> {
> --- 508,513 ----
> ***************
> *** 750,764 ****
> &log_hostname,
> false, NULL, NULL
> },
> - {
> - {"log_source_port", PGC_SIGHUP, LOGGING_WHAT,
> - gettext_noop("Logs the outgoing port number of the connecting host."),
> - NULL
> - },
> - &LogSourcePort,
> - false, NULL, NULL
> - },
> -
> {
> {"sql_inheritance", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
> gettext_noop("Causes subtables to be included by default in various commands."),
> --- 734,739 ----
> Index: src/backend/utils/misc/postgresql.conf.sample
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/misc/postgresql.conf.sample,v
> retrieving revision 1.107
> diff -c -r1.107 postgresql.conf.sample
> *** src/backend/utils/misc/postgresql.conf.sample 9 Mar 2004 04:43:07 -0000 1.107
> --- src/backend/utils/misc/postgresql.conf.sample 10 Mar 2004 16:07:49 -0000
> ***************
> *** 184,190 ****
> #log_connections = false
> #log_disconnections = false
> #log_duration = false
> - #log_pid = false
> #log_line_prefix = '' # e.g. '<%u%%%d> '
> # %u=user name %d=database name
> # %r=remote host and port
> --- 184,189 ----
> ***************
> *** 194,202 ****
> # %x=stop here in non-session processes
> # %%='%'
> #log_statement = false
> - #log_timestamp = false
> #log_hostname = false
> - #log_source_port = false
>
>
> #---------------------------------------------------------------------------
> --- 193,199 ----
> Index: src/include/tcop/tcopprot.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/include/tcop/tcopprot.h,v
> retrieving revision 1.61
> diff -c -r1.61 tcopprot.h
> *** src/include/tcop/tcopprot.h 29 Nov 2003 22:41:14 -0000 1.61
> --- src/include/tcop/tcopprot.h 10 Mar 2004 16:07:50 -0000
> ***************
> *** 30,36 ****
> extern bool InError;
> extern CommandDest whereToSendOutput;
> extern bool log_hostname;
> - extern bool LogSourcePort;
> extern DLLIMPORT const char *debug_query_string;
> extern char *rendezvous_name;
>
> --- 30,35 ----
> Index: src/include/utils/elog.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/include/utils/elog.h,v
> retrieving revision 1.65
> diff -c -r1.65 elog.h
> *** src/include/utils/elog.h 9 Mar 2004 04:43:07 -0000 1.65
> --- src/include/utils/elog.h 10 Mar 2004 16:07:50 -0000
> ***************
> *** 169,176 ****
> } PGErrorVerbosity;
>
> extern PGErrorVerbosity Log_error_verbosity;
> - extern bool Log_timestamp;
> - extern bool Log_pid;
> extern char *Log_line_prefix;
>
> #ifdef HAVE_SYSLOG
> --- 169,174 ----

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073