Skip site navigation (1) Skip section navigation (2)

Logging - events supported

From: Tim Holloway <mtsinc(at)southeast(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Logging - events supported
Date: 1999-10-24 18:22:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Following is an updated list of the messages to be channeled by the proposed logging system.

THESE AND *ONLY* THESE are slated for implementation. If you have items you want
included, PLEASE LET ME KNOW! As it stands, this is a pretty minimal set.

Bear in mind that the logger is NOT a debugger. Logged messages are expected to be related to administrative events,
including, but not limited to - server status (including load-balancing and fault
reporting), security, user connections, and service requests. Added are the 1xxx class, which is designed to assist the
existing debugging system by providing a linkage between the free-form debugging messages and the formalized log system.
via the LOGBUG macro, which write to both debugging output AND logging.

Hint 1: If you are about to emit a plethora of debugging messages and you want a timestamp and/or entry in a log
database, use LOGBUG and include a unique event ID in the message so that the two can be reconciled.

Hint 2: If you want to log specific debugging info into a database table, format it as appropriate for a table load and
route it to a channel destined for that table. E.g.:

 sprintf( tracebuffer, "'%l|MEMSHORTAGE'|%d|%d", ++event_id, bytes_used, max_bytes);
 LOGBUG( 1003, tracebuffer );


Logging classes:
1xz - The PostgreSQL server
2xx - User-related information
3xx - Transaction information
4xx - EXPLAIN results (???)
9xx - General system alerts
1000-1999 debugging events

Right now, the following are considered likely candidates,
subject to user feedback:

server info
 Server name, signal ID
101 - Server started
102 - Server shutdown
103 - Signal xxx received
104 - Server ABEND

user session
 userid, port or terminal ID, authentication scheme name
(e.g. md5). session ID
201 - User xxxx connected via port/terminal xxxxxxxx
authenticated by aaaaa
202 - User xxxx disconnected
203 - FORBIDDEN - connection denied for user xxxx via
port/terminal xxxxxxxxxx rejected by aaaaaaa

show commands
 Session ID, command text
301 - SELECT text
302 - INSERT text
303 - UPDATE text
304 - DELETE text

show results
 session ID, count or OID. primary/first/only table ID
401 - SUCCESS - nnn records retrieved
402 - SUCCESS - record inserted at OID
403 - SUCCESS - nnn records updated
404 - SUCCESS - nnn records deleted
405 - FORBIDDEN - action xxxxxx denied to user xxxx on table

 as below:
500 EXPLAIN transaction ID sequence cost rows bytes

 explanatory text
900 - Logging configuration file "ffff" was not found or
denied read access. Using default logging.
901 - Logging configuration file "ffff" could not be
processed - invalid text at line nnn.
902 - User overrides non-existent message ID nnn
903 - Channel requests non-existent message ID nnn
904 - end of section starting on line nnn was not found
905 - start of section ending on line nnn was not found
906 - (message from logging configuration file)

1000-1999 - LOGBUG macro 
 text - message text
user defines as needed - not standardized


pgsql-hackers by date

Next:From: Peter EisentrautDate: 1999-10-24 18:57:51
Subject: Re: [PATCHES] COMMENT ON patch
Previous:From: Tim HollowayDate: 1999-10-24 17:48:20
Subject: Re: [HACKERS] RFC: Industrial-strength logging (long message)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group