m-martinez / pg-audit-json

Simple, easily customised trigger-based auditing for PostgreSQL (Postgres). See also pgaudit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`application_name` is not being saved in the audit.log table

paulovieira opened this issue · comments

I noticed that application_name is not being saved. Turns out the call to current_setting has a wrong setting_name parameter: instead of

current_setting('audit.application_name', true)

it should be simply

current_setting('application_name', true)

https://github.com/m-martinez/pg-audit-json/blob/master/sql/pg-audit-json--1.0.2.sql#L223-L224

More details about application_name: https://www.postgresql.org/docs/current/runtime-config-logging.html#GUC-APPLICATION-NAME

By the way, the other setting the is supposed to be saved (application_user_name) doesn't seem to be valid.

Thanks for this nice tool!