Redshift / Client / enable_logging
enable_logging¶
- Redshift.Client.enable_logging(**kwargs)¶
Starts logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.
See also: AWS API Documentation
Request Syntax
response = client.enable_logging( ClusterIdentifier='string', BucketName='string', S3KeyPrefix='string', LogDestinationType='s3'|'cloudwatch'|'s3table', LogExports=[ 'string', ], S3TableKmsKeyId='string', S3TableGranularity='string' )
- Parameters:
ClusterIdentifier (string) –
[REQUIRED]
The identifier of the cluster on which logging is to be started.
Example:
exampleclusterBucketName (string) –
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
S3KeyPrefix (string) –
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 (@).LogDestinationType (string) – The log destination type. An enum with possible values of
s3,cloudwatch, ands3table.LogExports (list) –
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.(string) –
S3TableKmsKeyId (string) – The identifier of a customer managed KMS key used to encrypt the S3 tables. This parameter is valid only when
LogDestinationTypeiss3table.S3TableGranularity (string) – The scope of system table publishing. Valid values are
clusterandaccount. A value ofclusterscopes publishing to the individual cluster. A value ofaccountscopes publishing to the Amazon Web Services account. This parameter is valid only whenLogDestinationTypeiss3table.
- Return type:
dict
- Returns:
Response Syntax
{ 'LoggingEnabled': True|False, 'BucketName': 'string', 'S3KeyPrefix': 'string', 'LastSuccessfulDeliveryTime': datetime(2015, 1, 1), 'LastFailureTime': datetime(2015, 1, 1), 'LastFailureMessage': 'string', 'LogDestinationType': 's3'|'cloudwatch'|'s3table', 'LogExports': [ 'string', ], 'S3Tables': { 'S3Tables': [ 'string', ], 'S3TableNamespace': 'string', 'S3TableGranularity': 'string', 'EnabledAll': True|False, 'LastIngestionTimes': { 'string': 'string' } } }
Response Structure
(dict) –
Describes the status of logging for a cluster.
LoggingEnabled (boolean) –
trueif logging is on,falseif logging is off.BucketName (string) –
The name of the S3 bucket where the log files are stored.
S3KeyPrefix (string) –
The prefix applied to the log file names.
LastSuccessfulDeliveryTime (datetime) –
The last time that logs were delivered.
LastFailureTime (datetime) –
The last time when logs failed to be delivered.
LastFailureMessage (string) –
The message indicating that logs failed to be delivered.
LogDestinationType (string) –
The log destination type. An enum with possible values of
s3,cloudwatch, ands3table.LogExports (list) –
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.(string) –
S3Tables (dict) –
The status of system table publishing to S3 Tables. This field is populated only when system table publishing is active.
S3Tables (list) –
The system tables currently being published.
(string) –
S3TableNamespace (string) –
The namespace in the S3 table bucket that holds the published tables.
S3TableGranularity (string) –
The scope of system table publishing in effect. Possible values are
clusterandaccount.EnabledAll (boolean) –
trueif the cluster is enrolled in all current and future system tables rather than an explicit subset.LastIngestionTimes (dict) –
A map whose keys are the names of the published system tables and whose values are the time each table last received data. Use this to judge data freshness.
(string) –
(string) –
Exceptions
Redshift.Client.exceptions.ClusterNotFoundFaultRedshift.Client.exceptions.BucketNotFoundFaultRedshift.Client.exceptions.InsufficientS3BucketPolicyFaultRedshift.Client.exceptions.InvalidS3KeyPrefixFaultRedshift.Client.exceptions.InvalidS3BucketNameFaultRedshift.Client.exceptions.InvalidClusterStateFaultRedshift.Client.exceptions.UnsupportedOperationFault