Audit Log File v10
The audit log file can be generated in either CSV or XML format depending upon the setting of the
edb_audit configuration parameter. The XML format contains less information than the CSV format.
The information in the audit log is based on the logging performed by PostgreSQL as described in the section “Using CSV-Format Log Output” within Section “Error Reporting and Logging” in the PostgreSQL core documentation, available at:
The following table lists the fields in the order they appear in the CSV audit log format. The table contains the following information:
- Field. Name of the field as shown in the sample table definition in the PostgreSQL documentation as previously referenced.
- XML Element/Attribute. For the XML format, name of the XML element and its attribute (if used), referencing the value. Note:
n/aindicates that there is no XML representation for this field.
- Data Type. Data type of the field as given by the PostgreSQL sample table definition.
- Description. Description of the field. For certain fields, no output is generated in the audit log as those fields are not supported by auditing. Those fields are indicated by “Not supported”.
The fields with the
Description of “Not supported” appear as consecutive commas (,,) in the CSV format.
|Field||XML Element/Attribute||Data Type||Description|
|Log date/time of the statement.|
|Database user who executed the statement.|
|Database in which the statement was executed.|
|Operating system process ID in which the statement was executed.|
|Host and port location from where the statement was executed.|
|Session ID in which the statement was executed.|
|Order of the statement within the session.|
|Date/time when the session was started.|
|Virtual transaction ID of the statement.|
|Regular transaction ID of the statement.|
|Statement severity. Values are |
|SQL state code returned for the statement.|
|The SQL statement that was attempted for execution.|
|Error message detail. (Not supported)|
|Hint (Not supported)|
|Internal query that led to the error, if any. (Not supported)|
|Character count of the error position therein. (Not supported)|
|Error context. (Not supported)|
|User query that led to the error. (For errors only)|
|Character count of the error position therein. (For errors only)|
|Location of the error in the PostgreSQL source code. (Not supported)|
|Name of the application from which the statement was executed. (for example, |
|SQL command of the statement.|
|Value specified by the |
The following examples are generated in the CSV and XML formats.
The non-default audit settings in the
postgresql.conf file are as follows:
edb_audit parameter is changed to
xml when generating the XML format.
The audited session is the following:
CSV Audit Log File
The following is the CSV format of the audit log file.
Each audit log entry has been split and displayed across multiple lines, and a blank line has been inserted between the audit log entries for more clarity in the appearance of the results.
XML Audit Log File
The following is the XML format of the audit log file. The output has been formatted for more clarity in the appearance in the example.