EnableLogging
Starts logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
- ClusterIdentifier
-
The identifier of the cluster on which logging is to be started.
Example:
exampleclusterType: String
Length Constraints: Maximum length of 2147483647.
Required: Yes
- BucketName
-
The name of an existing S3 bucket where the log files are to be stored.
Constraints:
-
Must be in the same region as the cluster
-
The cluster must have read bucket and put object permissions
Type: String
Length Constraints: Maximum length of 2147483647.
Required: No
-
- LogDestinationType
-
The log destination type. An enum with possible values of
s3,cloudwatch, ands3table.Type: String
Valid Values:
s3 | cloudwatch | s3tableRequired: No
- LogExports.member.N
-
The collection of exported log types. When
LogDestinationTypeiss3orcloudwatch, possible values areconnectionlog,useractivitylog, anduserlog. WhenLogDestinationTypeiss3table, the values are the names of the system tables to publish. Omitting this parameter, passing an empty list, or including the valueallpublishes all current and future system tables.Type: Array of strings
Length Constraints: Maximum length of 2147483647.
Required: No
- S3KeyPrefix
-
The prefix applied to the log file names.
Valid characters are any letter from any language, any whitespace character, any numeric character, and the following characters: underscore (
_), period (.), colon (:), slash (/), equal (=), plus (+), backslash (\), hyphen (-), at symbol (@).Type: String
Length Constraints: Maximum length of 256.
Pattern:
[\p{L}\p{Z}\p{N}_.:/=+\-@]*Required: No
- S3TableGranularity
-
The scope of system table publishing. Valid values are
clusterandaccount. A value ofclusterscopes publishing to the individual cluster. A value ofaccountscopes publishing to the AWS account. This parameter is valid only whenLogDestinationTypeiss3table.Type: String
Length Constraints: Maximum length of 2147483647.
Required: No
- S3TableKmsKeyId
-
The identifier of a customer managed AWS KMS key used to encrypt the S3 tables. This parameter is valid only when
LogDestinationTypeiss3table.Type: String
Length Constraints: Maximum length of 2147483647.
Required: No
Response Elements
The following elements are returned by the service.
- BucketName
-
The name of the S3 bucket where the log files are stored.
Type: String
Length Constraints: Maximum length of 2147483647.
- LastFailureMessage
-
The message indicating that logs failed to be delivered.
Type: String
Length Constraints: Maximum length of 2147483647.
- LastFailureTime
-
The last time when logs failed to be delivered.
Type: Timestamp
- LastSuccessfulDeliveryTime
-
The last time that logs were delivered.
Type: Timestamp
- LogDestinationType
-
The log destination type. An enum with possible values of
s3,cloudwatch, ands3table.Type: String
Valid Values:
s3 | cloudwatch | s3table - LogExports.member.N
-
The collection of exported log types. When
LogDestinationTypeiss3orcloudwatch, possible values areconnectionlog,useractivitylog, anduserlog. WhenLogDestinationTypeiss3table, the values are the names of the system tables being published.Type: Array of strings
Length Constraints: Maximum length of 2147483647.
- LoggingEnabled
-
trueif logging is on,falseif logging is off.Type: Boolean
- S3KeyPrefix
-
The prefix applied to the log file names.
Type: String
Length Constraints: Maximum length of 256.
Pattern:
[\p{L}\p{Z}\p{N}_.:/=+\-@]* - S3Tables
-
The status of system table publishing to S3 Tables. This field is populated only when system table publishing is active.
Type: S3TablePublishStatus object
Errors
For information about the errors that are common to all actions, see Common Error Types.
- BucketNotFoundFault
-
Could not find the specified S3 bucket.
HTTP Status Code: 400
- ClusterNotFound
-
The
ClusterIdentifierparameter does not refer to an existing cluster.HTTP Status Code: 404
- InsufficientS3BucketPolicyFault
-
The cluster does not have read bucket or put object permissions on the S3 bucket specified when enabling logging.
HTTP Status Code: 400
- InvalidClusterState
-
The specified cluster is not in the
availablestate.HTTP Status Code: 400
- InvalidS3BucketNameFault
-
The S3 bucket name is invalid. For more information about naming rules, go to Bucket Restrictions and Limitations in the Amazon Simple Storage Service (S3) Developer Guide.
HTTP Status Code: 400
- InvalidS3KeyPrefixFault
-
The string specified for the logging S3 key prefix does not comply with the documented constraints.
HTTP Status Code: 400
- UnsupportedOperation
-
The requested operation isn't supported.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: