Reference for the pgAudit extension
You can specify the level of detail that you want for your audit log by changing one or more of the parameters listed in this section.
Controlling pgAudit behavior
You can control the audit logging by changing one or more of the parameters listed in the following table.
Parameter | Description |
---|---|
| Specifies the statement classes that will be logged by session audit logging. Allowable values include ddl, function, misc, read, role, write, none, all. For more information, see List of allowable settings for the pgaudit.log parameter. |
|
When turned on (set to 1), adds statements to audit trail if all relations in a statement are in pg_catalog. |
|
Specifies the log level to use for log entries. Allowed values: debug5, debug4, debug3, debug2, debug1, info, notice, warning, log |
|
When turned on (set to 1), parameters passed with the statement are captured in the audit log. |
|
When turned on (set to 1), the audit log for the session creates a separate log entry for each relation (TABLE, VIEW, and so on) referenced in a SELECT or DML statement. |
|
Specifies whether logging will include the statement text and parameters with the first log entry for a statement/substatement combination or with every entry. |
|
Specifies the master role to use for object audit logging. The only allowable entry is |
List of allowable settings for the pgaudit.log
parameter
Value | Description |
---|---|
none | This is the default. No database changes are logged. |
all | Logs everything (read, write, function, role, ddl, misc). |
ddl | Logs all data definition language (DDL) statements that
aren't included in the |
function | Logs function calls and |
misc | Logs miscellaneous commands, such as |
read | Logs |
role | Logs statements related to roles and privileges, such as
|
write | Logs |
To log multiple event types with session auditing, use a comma-separated list. To log all event types,
set pgaudit.log
to ALL
. Reboot your DB instance to apply the changes.
With object auditing, you can refine audit logging to work with specific relations. For
example, you can specify that you want audit logging for READ
operations on one or more tables.