Thread: automated log-messages

automated log-messages

From
Joern Muehlencord
Date:
Hi,

I am trying to implement an automated log-message system for my
application. For example, if a new user is inserted to my table "auth",
I want to create a log message like: "user [name] added to system". Is
it possible to add this message with triggers or rules?! If so, can
anyone give some examples?


Thanx,Joern
-- 
Linux is like a wigwam - no Windows, no Gates and Apache inside


Re: automated log-messages

From
"J.H.M. Dassen (Ray)"
Date:
On Fri, Jan 12, 2001 at 07:59:26 +0100, Joern Muehlencord wrote:
> I am trying to implement an automated log-message system for my
> application. For example, if a new user is inserted to my table "auth",
> I want to create a log message like: "user [name] added to system". Is
> it possible to add this message with triggers or rules?!

It can be done using a trigger procedure in Pl/pgSQL, using a "RAISE"
statement; see
http://postgresql.rmplc.co.uk/devel-corner/docs/postgres/plpgsql-description.htm#AEN6187

HTH,
Ray
-- 
"The proper place for a CAPSLOCK key is in a different hemisphere from you."Tom Christiansen in "Interface
Zen",http://slashdot.org/article.pl?sid=99/11/30/0954216