create_session_logger
async
¶
create_session_logger(
event_filter: EventFilter,
log_configuration: LogConfiguration,
*,
config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
display_name: Optional[DisplayNameSafe] = None,
customer_managed_key: Optional[keyArn] = None,
additional_encryption_context: Optional[EncryptionContextMap] = None,
tags: Optional[TagList] = None,
client_token: Optional[ClientToken] = None,
) -> CreateSessionLoggerResponse
Creates a session logger.
Parameters:
-
event_filter(EventFilter) –The filter that specifies the events to monitor.
-
log_configuration(LogConfiguration) –The configuration that specifies where logs are delivered.
-
display_name(Optional[DisplayNameSafe], default:None) –The human-readable display name for the session logger resource.
-
customer_managed_key(Optional[keyArn], default:None) –The custom managed key of the session logger.
-
additional_encryption_context(Optional[EncryptionContextMap], default:None) –The additional encryption context of the session logger.
-
tags(Optional[TagList], default:None) –The tags to add to the session logger.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request. If you do not specify a client token, one is automatically generated by the AWS SDK.
Raises:
-
AccessDeniedException–Access is denied.
-
ConflictException–There is a conflict.
-
InternalServerException–There is an internal server error.
-
ServiceQuotaExceededException–The service quota has been exceeded.
-
ThrottlingException–There is a throttling error.
-
ValidationException–There is a validation error.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create Session Logger with All Events Creates a session logger that captures all events and stores them in S3 with JSON format and flat folder structure
>>> await client.create_session_logger(event_filter={'all': {}}, log_configuration={'s3': {'bucket': 'my-session-logs-bucket', 'keyPrefix': 'session-logs/all/events', 'bucketOwner': '123456789012', 'logFileFormat': 'Json', 'folderStructure': 'Flat'}}, display_name='Session Logger with All Events')
Create Session Logger with Specific Events
Creates a session logger that captures only specific events with JSONLines format and nested folder structure
>>> await client.create_session_logger(event_filter={'include': ['SessionStart', 'SessionEnd', 'UrlLoad', 'WebsiteInteract']}, log_configuration={'s3': {'bucket': 'my-session-logs-bucket', 'keyPrefix': 'session-logs/each/event', 'bucketOwner': '123456789012', 'logFileFormat': 'JSONLines', 'folderStructure': 'NestedByDate'}}, display_name='Session Logger with Each Events', customer_managed_key='arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012', additional_encryption_context={'EncryptionContextKey': 'EncryptionContextValue'}, tags=[{'Key': 'KEY-1', 'Value': 'VALUE-1'}, {'Key': 'KEY-2', 'Value': 'VALUE-2'}])
Source code in docs_src/capo_workspaces_web/_services/async_work_spaces_web.py
4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 | |