Logging for OCI Database with PostgreSQL
Use this information to manage logs for OCI Database with PostgreSQL database systems.
The OCI Database with PostgreSQL service uses the OCI Logging service to manage logging for database systems. See Logging Overview and Enable Logging on the Logs page for general information on logging, including how to name log files and create log groups.
No extra policies are required to enable logging. You only need to have permission to configure the database system.
Logging is an option in the OCI Database with PostgreSQL service. Standard limits, restrictions, and rates apply when enabling the logging features. See Logging for more information.
Resources
- database systems
Log Categories
API value (ID): | Console (Display Name) | Description |
---|---|---|
postgresql_database_logs |
PostgreSQL Database Logs | PostgreSQL database system logs. |
Availability
OCI Database with PostgreSQL logging is available in all the regions of the commercial realms.
Contents of a Database Log
OCI Database with PostgreSQL logs capture detailed information about database queries and parameters. Details appear as values in the data
field. This value is a JSON-formatted data with the following fields.
dbSystemId
dbInstanceId
user_name
database_name
process_id
connection_from
session_id
session_line_num
command_tag
session_start_time
virtual_transaction_id
transaction_id
error_severity
sql_state_code
level
message
detail
hint
internal_query
internal_query_pos
conString
query
query_pos
location
application_name
backend_type
leader_pid
query_id
For more information on these properties, see Error Reporting and Logging in the PostgreSQL reference manual.
An Example OCI Database with PostgreSQL Log
{
"specversion" : "1.0",
"type" : "com.oraclecloud.postgresql.postgresqlDbSystem.postgresql_database_logs",
"source" : "DBSYSTEM_NAME",
"subject" : "dbinstance-ff36735edea9"
"id" : "DBSYSTEMNAME_2e594e66-11e9-4841-bfc6-dc7daf501a86",
"time" : "2023-06-06T21:02:40.584Z",
"oracle": {
"logid": "ocid1.log.region1...exampleuniqueID",
"ingestedtime": "2022-05-22T04:17:31.222Z"
},
"data" : {
"dbSystemId": "ocid1.postgresqldbsystem.oc1.iad.exampleuniqueID",
"dbInstanceId": "c8418d0a-93fa-4b3f-ac69-ff36735edea9",
"user_name":"oci_metrics",
"database_name":"postgres",
"process_id":2113,
"connection_from":"172.17.0.1:49218",
"session_id":"648a97e8.841",
"session_line_num":9,
"command_tag":"startup",
"session_start_time":"2023-06-15 04:47:36 GMT",
"virtual_transaction_id":"3/544",
"transaction_id":0,
"error_severity":"LOG",
"sql_state_code":"00000",
"level":"LOG",
"message":"setting \"DateStyle\"=ISO",
"detail":"",
"hint":"",
"internal_query":"",
"internal_query_pos":null,
"conString":"",
"query":"",
"query_pos":null,
"location":"",
"application_name":"postrgesql",
"backend_type":"client backend",
"leader_pid":null,
"query_id":0
}
}