ybm cluster db-query-logging
Use the cluster db-query-logging
resource to perform operations on a YugabyteDB Aeon cluster, including the following:
- enable, disable, and update db query logging
- get information about db query logging
Prerequisite
Before using these commands, you must have an integration configuration already set up. This configuration defines the authentication and connection details for the third-party tool where logs will be exported.
Syntax
Usage: ybm cluster db-query-logging [command] [flags]
Examples
Enable database query logging for a cluster:
ybm cluster db-query-logging enable \
--cluster-name your-cluster \
--integration-name your-integration \
--log-line-prefix "%m :%r :%u @ %d :[%p] : " \
--log-min-duration-statement -1 \
--log-connections false \
--log-duration false \
--log-error-verbosity DEFAULT \
--log-statement NONE
Disable database query logging for a cluster.
ybm cluster db-query-logging disable \
--cluster-name your-cluster
Get information about database query logging for a cluster.
ybm cluster db-query-logging describe --cluster-name your-cluster
Update some fields of the log configuration.
ybm cluster db-query-logging update \
--cluster-name "your-cluster" \
--integration-name your-integration \
--log-line-prefix "%m :%r :%u @ %d :[%p] :" \
--log-min-duration-statement 60
Commands
enable
Enable database query logging for a cluster and export the logs to the integration passed in the flag --integration-name
.
Flag | Description |
---|---|
--cluster-name | Required. Name of the cluster whose database logging you want to enable. |
--integration-name | Required. Name of the integration that you want to use to export the logs. |
--debug-print-plan | Optional. Enables output of debugging output. Default is false . |
--log-min-duration-statement | Optional. Duration (in ms) of each completed statement to be logged if the statement ran for at least the specified amount of time. Default is -1 (log all statements). |
--log-connections | Optional. Log connection attempts. Default is false . |
--log-disconnections | Optional. Log session disconnections. Default is false . |
--log-duration | Optional. Log the duration of each completed statement. Default is false . |
--log-error-verbosity | Optional. Controls the amount of detail written in the server log for each message that is logged. Arguments:
DEFAULT . |
--log-statement | Optional. Log all statements or specific types of statements. Arguments:
NONE . |
--log-min-error-statement | Optional. Minimum error severity for logging the statement that caused it. Arguments:
ERROR . |
--log-line-prefix | Optional. A printf-style format string for log line prefixes. Default is %m :%r :%u @ %d :[%p] : . |
disable
Disable database query logging for a cluster.
Flag | Description |
---|---|
--cluster-name | Required. Name of the cluster whose database logging you want to disable. |
-f, --force | Optional. Bypass the prompt for non-interactive usage. |
Describe
Fetch detailed information about the logging configuration for a cluster.
Flag | Description |
---|---|
--cluster-name | Required. Name of the cluster for which you want to fetch the database query logging configuration. |
update
Update the database query logging configuration of a cluster.
Flag | Description |
---|---|
--cluster-name | Required. Name of the cluster with database query logging configuration you want to update. |
--debug-print-plan | Optional. Enables output of debugging output. |
--integration-name | Optional. Name of the Integration. |
--log-connections | Optional. Log connection attempts. |
--log-disconnections | Optional. Log session disconnections. |
--log-duration | Optional. Log the duration of each completed statement. |
--log-error-verbosity | Optional. Controls the amount of detail written in the server log for each message that is logged. Arguments:
|
--log-line-prefix | Optional. A printf-style format string for log line prefixes. |
--log-min-duration-statement | Optional. Duration (in ms) of each completed statement to be logged if the statement ran for at least the specified amount of time. Default is -1 (log all statements). |
--log-min-error-statement | Optional. Minimum error severity for logging the statement that caused it. Arguments:
|
--log-statement | Optional. Log all statements or specific types of statements. Arguments:
|