Re: 7.0 RPMS and syslog problem. (more)

Lists: pgsql-hackers
From: Michael Schout <mschout(at)gkg(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: 7.0 RPMS and syslog problem.
Date: 2000-05-17 14:26:05
Message-ID: 20000517092605.A18016@gkg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi.

I've installed the v7.0 postgresql RPMS from ftp.postgresql.org. I configured
my syslog to catch the local0 facility and log it to /var/log/pgsql with this
entry in /etc/syslog.conf:

local0.* /var/log/pgsql

This catches just about everything. However, if I fire up "psql template1" and
issue the command "\d", the following is broadcast to all tty's on the machine:

Message from syslogd(at)galaxy at Wed May 17 09:20:12 2000 ...
galaxy

My guess is that something is not logging to the correct facility. Has anyone
else seen this / found a work around for this?

my pg_options file contains:
verbose=1
query=4
syslog=2

Mike


From: Michael Schout <mschout(at)gkg(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.0 RPMS and syslog problem. (more)
Date: 2000-05-17 14:44:53
Message-ID: 20000517094453.A18138@gkg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Upon further investigation, I found that when the hostname is broadcast to everyone, the following also appears in /var/log/messages:

May 17 09:28:11 galaxy
May 17 09:28:11 galaxy syslogd: Cannot glue message parts together
May 17 09:28:11 galaxy 135>May 17 09:28:11 postgres[18087]: query: SELECT c.relname as "Name", 'table'::text as "Type", u.usename as "Owner" FROM pg_class c, pg_user u WHERE c.relowner = u.usesysid AND c.relkind = 'r' AND not exists (select 1 from pg_views where viewname = c.relname) AND c.relname !~ '^pg_' UNION SELECT c.relname as "Name", 'table'::text as "Type", NULL as "Owner" FROM pg_class c WHERE c.relkind = 'r' AND not exists (select 1 from pg_views where viewname = c.relname) AND not exists (select 1 from pg_user where usesysid = c.relowner) AND c.relname !~ '^pg_' UNION SELECT c.relname as "Name", 'view'::text as "Type", u.usename as "Owner" FROM pg_class c, pg_user u WHERE c.relowner = u.usesysid AND c.relkind = 'r' AND exists (select 1 from pg_views where viewname = c.relname) AND c.relname !~ '^pg_' UNION SELECT c.relname as "Name", 'view'::text as "Type", NULL as "Owner" FROM pg_class c WHERE c.relkind = 'r' AND exists (select 1 from pg_views whe!
re viewname = c.relname) AND not exists (select 1 fro
May 17 09:28:11 galaxy m pg_user where usesysid = c.relowner) AND c.relname !~ '^pg_' UNION SELECT c.relname as "Name", (CASE WHEN relkind = 'S' THEN 'sequence'::text ELSE 'index'::text END) as "Type", u.usename as "Owner" FROM pg_class c, pg_user u WHERE c.relowner = u.usesysid AND relkind in ('S') AND c.relname !~ '^pg_' UNION SELECT c.relname as "Name", (CASE WHEN relkind = 'S' THEN 'sequence'::text ELSE 'index'::text END) as "Type", NULL as "Owner" FROM pg_class c WHERE not exists (select 1 from pg_user where usesysid = c.relowner) AND relkind in ('S') AND c.relname !~ '^pg_' ORDER BY "Name"

So the problem seems to stem from the "Cannot glue message parts together"

The hostname is being broadcast to with the level of "emerg" because if I
remove:

*.emerg *

from my syslog.conf file, I dont see the console message getting broadcast
anymore.

If anyone else has seen this or has any ideas, please let me know :).

Mike


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Schout <mschout(at)gkg(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.0 RPMS and syslog problem. (more)
Date: 2000-05-17 15:59:15
Message-ID: 17233.958579155@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Michael Schout <mschout(at)gkg(dot)net> writes:
> Upon further investigation, I found that when the hostname is broadcast to everyone, the following also appears in /var/log/messages:
> May 17 09:28:11 galaxy
> May 17 09:28:11 galaxy syslogd: Cannot glue message parts together

Hmm. We were just discussing this a few weeks ago, when someone
suggested making the syslog option be the default and I wanted to
know if it was really robust enough for that. Seems it's not.
On at least some platforms, syslog can't cope with log messages
exceeding a few hundred characters. Postgres 7.0 is quite capable
of putting out log messages in the megabyte range, if you have debug
logging turned on --- just shove a sufficiently long query at it.

So I'm afraid the answer is that syslog and verbose logging won't
play together, at least not on your platform. Sorry.

We really need a better logging answer...

regards, tom lane


From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Schout <mschout(at)gkg(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.0 RPMS and syslog problem. (more)
Date: 2000-05-17 16:55:59
Message-ID: 3922CF1F.DBEC27DB@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:

> Michael Schout <mschout(at)gkg(dot)net> writes:
> > Upon further investigation, I found that when the hostname is broadcast to everyone, the following also appears in /var/log/messages:
> > May 17 09:28:11 galaxy
> > May 17 09:28:11 galaxy syslogd: Cannot glue message parts together

> Hmm. We were just discussing this a few weeks ago, when someone
> suggested making the syslog option be the default and I wanted to
> know if it was really robust enough for that. Seems it's not.

> So I'm afraid the answer is that syslog and verbose logging won't
> play together, at least not on your platform. Sorry.

> We really need a better logging answer...

Splitting the logging message out to syslog in tprintf() (or its
replacement) would work, if we knew the syslog gluing buffer maxlen. A
'packetized' logging system of this sort might work....

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11


From: Michael Schout <mschout(at)gkg(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: 7.0 RPMS and syslog problem. (more)
Date: 2000-05-17 22:52:14
Message-ID: 20000517175214.A19783@gkg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 17, 2000 at 11:59:15AM -0400, Tom Lane wrote:
> Michael Schout <mschout(at)gkg(dot)net> writes:
>
> Hmm. We were just discussing this a few weeks ago, when someone
> suggested making the syslog option be the default and I wanted to
> know if it was really robust enough for that. Seems it's not.

Perhaps the maintainer of the binary RPMS on ftp.postgresql.org
could rebuild with syslog logging turned off by default?

Mike


From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: Michael Schout <mschout(at)gkg(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.0 RPMS and syslog problem. (more)
Date: 2000-05-18 03:37:10
Message-ID: 39236566.7F70BB36@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Michael Schout wrote:
> On Wed, May 17, 2000 at 11:59:15AM -0400, Tom Lane wrote:
> > Hmm. We were just discussing this a few weeks ago, when someone
> > suggested making the syslog option be the default and I wanted to
> > know if it was really robust enough for that. Seems it's not.

> Perhaps the maintainer of the binary RPMS on ftp.postgresql.org
> could rebuild with syslog logging turned off by default?

Set the pg_options -- ie, set syslog to 0, or set query to 0, if you
don't need query logging. There's no need to recompile, as the runtime
option sets things properly. I would prefer to not disable syslog when
it is working fine for those who have shorter queries. I will, however,
change the default pg_options with syslog set to 0 -- same effect, but
it still allows those with less difficult query-length requirements to
use the feature -- with the caveat that too long a query with query
logging on will crash out syslog.

So, I have two notices to add to the ramifordistat page, and to the
README.rpm..... I won't build a -2 release as yet, until we get the
actual query length of overflow (volunteers?) so that it can be
documented.

If you want to completely disable syslog on your own RPMS, feel free to
download the src.rpm, edit rpm-pgsql-7.0.patch to remove the USE_SYSLOG
define, and rebuild with rpm -ba. Then install the resulting RPMs. If
you wouldn't mind, change the release number so that no one gets
confused.

HTH

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11