per user logging

Started by snacktimeover 20 years ago5 messagesgeneral
Jump to latest
#1snacktime
snacktime@gmail.com

I'm pretty sure the answer to this is no, but just in case I've missed
something. Is there a way to configure the server so it only logs for
specific users?

Chris

#2Peter Eisentraut
peter_e@gmx.net
In reply to: snacktime (#1)
Re: per user logging

snacktime wrote:

I'm pretty sure the answer to this is no, but just in case I've
missed something. Is there a way to configure the server so it only
logs for specific users?

No, but you can configure PostgreSQL to insert the user name into each
log message, and then you could configure your syslog daemon to
redirect (or delete) messages according to that user name.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#3Richard Huxton
dev@archonet.com
In reply to: snacktime (#1)
Re: per user logging

snacktime wrote:

I'm pretty sure the answer to this is no, but just in case I've missed
something. Is there a way to configure the server so it only logs for
specific users?

Look into "ALTER USER" - that lets you set (some) configuration options
on a per-user level. Don't know if the logging is one of the things you
can change though. Be interested in finding out though (hint, hint).

--
Richard Huxton
Archonet Ltd

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#2)
Re: per user logging

Peter Eisentraut <peter_e@gmx.net> writes:

snacktime wrote:

I'm pretty sure the answer to this is no, but just in case I've
missed something. Is there a way to configure the server so it only
logs for specific users?

No, but you can configure PostgreSQL to insert the user name into each
log message, and then you could configure your syslog daemon to
redirect (or delete) messages according to that user name.

I believe it is possible for a superuser to do something like
"ALTER USER victim SET log_min_messages = whatever", so that the
log verbosity is different for different users.

regards, tom lane

#5snacktime
snacktime@gmail.com
In reply to: Tom Lane (#4)
Re: per user logging

I believe it is possible for a superuser to do something like
"ALTER USER victim SET log_min_messages = whatever", so that the
log verbosity is different for different users.

regards, tom lane

I'll try that and see how it works.