Re: Logging at schema level

From: Scott Mead <scottm(at)openscg(dot)com>
To: Nikhil <nikhilsmenon(at)gmail(dot)com>
Cc: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Logging at schema level
Date: 2017-07-21 11:23:54
Message-ID: CAKq0gv+OPuyVRrM5j7eGDfZ=wR=k=qX5FJCzqT_6CYDqGfek6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 21, 2017 at 2:11 AM, Nikhil <nikhilsmenon(at)gmail(dot)com> wrote:

> Schema = tenant. So basically tenant level logging.
>

If each tenant uses a separate user, you could parse this by that user.
You can't separate the logs by user, but, you could use a tool like
pgBadger to parse reports for each individual user (tenant) in the system
and present the logs that way:

From: https://github.com/dalibo/pgbadger
....
-u | --dbuser username : only report on entries for the given user.
....

--
Scott Mead
Sr. Architect
*OpenSCG <http://openscg.com>*
http://openscg.com

>
> On 21-Jul-2017 11:21 AM, "Andreas Kretschmer" <andreas(at)a-kretschmer(dot)de>
> wrote:
>
>> On 21 July 2017 07:10:42 GMT+02:00, Nikhil <nikhilsmenon(at)gmail(dot)com>
>> wrote:
>> >Hello,
>> >
>> >I am using postgresql schema feature for multi-tenancy. can we get
>> >postgresql logs at schema level. Currently it is for the whole database
>> >server (pg_log)
>> >
>>
>> What do you want to achieve? Logging of data-changes per tenant?
>>
>> Regards, Andreas.
>>
>>
>> --
>> 2ndQuadrant - The PostgreSQL Support Company
>>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jordan Gigov 2017-07-21 11:47:05 pg_restore misuse or bug?
Previous Message Michael Paquier 2017-07-21 06:27:15 Re: Logging at schema level