Thread: [ADMIN] auditing in rds or triggers that write to pg_log

[ADMIN] auditing in rds or triggers that write to pg_log

From
Mike Broers
Date:
I'm investigating ways to track all interactions with certain tables in postgres.  pgaudit seems like a great solution but it doesnt look like its a supported extension in rds yet.  

I've considered creating triggers that record interactions into the standard postgresql log file but I cant find examples of this approach, only examples that write to tables.  Is it possible to do this?

Thanks
Mike

Re: [ADMIN] auditing in rds or triggers that write to pg_log

From
Cachique
Date:
Hi Mike.
In any of your plpgsql function you can use RAISE LOG 'Blah, Blah...' the same way you use RAISE NOTICE.
All this text go directly to your standard postgresql log file.

Regards,
Walter

On Thu, Mar 9, 2017 at 2:37 PM, Mike Broers <mbroers@gmail.com> wrote:
I'm investigating ways to track all interactions with certain tables in postgres.  pgaudit seems like a great solution but it doesnt look like its a supported extension in rds yet.  

I've considered creating triggers that record interactions into the standard postgresql log file but I cant find examples of this approach, only examples that write to tables.  Is it possible to do this?

Thanks
Mike


Re: [ADMIN] auditing in rds or triggers that write to pg_log

From
Mike Broers
Date:
I think this is exactly what i was looking for, thanks!!

On Thu, Mar 9, 2017 at 11:49 AM, Cachique <cachique@gmail.com> wrote:
Hi Mike.
In any of your plpgsql function you can use RAISE LOG 'Blah, Blah...' the same way you use RAISE NOTICE.
All this text go directly to your standard postgresql log file.

Regards,
Walter

On Thu, Mar 9, 2017 at 2:37 PM, Mike Broers <mbroers@gmail.com> wrote:
I'm investigating ways to track all interactions with certain tables in postgres.  pgaudit seems like a great solution but it doesnt look like its a supported extension in rds yet.  

I've considered creating triggers that record interactions into the standard postgresql log file but I cant find examples of this approach, only examples that write to tables.  Is it possible to do this?

Thanks
Mike



Re: [ADMIN] auditing in rds or triggers that write to pg_log

From
Cachique
Date:
Mike:
You would also want to check the documentation on Error Reporting and Logging
https://www.postgresql.org/docs/current/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN
Take a look on client_min_messages that can be set on a per session basis.

Regards,
Walter

On Thu, Mar 9, 2017 at 2:51 PM, Mike Broers <mbroers@gmail.com> wrote:
I think this is exactly what i was looking for, thanks!!

On Thu, Mar 9, 2017 at 11:49 AM, Cachique <cachique@gmail.com> wrote:
Hi Mike.
In any of your plpgsql function you can use RAISE LOG 'Blah, Blah...' the same way you use RAISE NOTICE.
All this text go directly to your standard postgresql log file.

Regards,
Walter

On Thu, Mar 9, 2017 at 2:37 PM, Mike Broers <mbroers@gmail.com> wrote:
I'm investigating ways to track all interactions with certain tables in postgres.  pgaudit seems like a great solution but it doesnt look like its a supported extension in rds yet.  

I've considered creating triggers that record interactions into the standard postgresql log file but I cant find examples of this approach, only examples that write to tables.  Is it possible to do this?

Thanks
Mike