AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates a session logger.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateSessionLoggerAsync.

Namespace: Amazon.WorkSpacesWeb
Assembly: AWSSDK.WorkSpacesWeb.dll
Version: 3.x.y.z

Syntax

C#
public abstract CreateSessionLoggerResponse CreateSessionLogger(
         CreateSessionLoggerRequest request
)

Parameters

request
Type: Amazon.WorkSpacesWeb.Model.CreateSessionLoggerRequest

Container for the necessary parameters to execute the CreateSessionLogger service method.

Return Value


The response from the CreateSessionLogger service method, as returned by WorkSpacesWeb.

Exceptions

ExceptionCondition
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.

Examples

Creates a session logger that captures all events and stores them in S3 with JSON format and flat folder structure

Create Session Logger with All Events


var client = new AmazonWorkSpacesWebClient();
var response = client.AssociateSessionLogger(new AssociateSessionLoggerRequest 
{
    PortalArn = "arn:aws:workspaces-web:us-west-2:123456789012:portal/12345678-1234-1234-1234-123456789012",
    SessionLoggerArn = "arn:aws:workspaces-web:us-west-2:123456789012:sessionLogger/11111111-1111-1111-1111-111111111111"
});

string portalArn = response.PortalArn;
string sessionLoggerArn = response.SessionLoggerArn;

            

Creates a session logger that captures only specific events with JSONLines format and nested folder structure

Create Session Logger with Specific Events


var client = new AmazonWorkSpacesWebClient();
var response = client.CreateSessionLogger(new CreateSessionLoggerRequest 
{
    AdditionalEncryptionContext = new Dictionary<string, string> {
        { "EncryptionContextKey", "EncryptionContextValue" }
    },
    CustomerManagedKey = "arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012",
    DisplayName = "Session Logger with Each Events",
    EventFilter = new EventFilter { Include = new List<string> {
        "SessionStart",
        "SessionEnd",
        "UrlLoad",
        "WebsiteInteract"
    } },
    LogConfiguration = new LogConfiguration { S3 = new S3LogConfiguration {
        Bucket = "my-session-logs-bucket",
        BucketOwner = "123456789012",
        FolderStructure = "NestedByDate",
        KeyPrefix = "session-logs/each/event",
        LogFileFormat = "JSONLines"
    } },
    Tags = new List<Tag> {
        new Tag {
            Key = "KEY-1",
            Value = "VALUE-1"
        },
        new Tag {
            Key = "KEY-2",
            Value = "VALUE-2"
        }
    }
});

string sessionLoggerArn = response.SessionLoggerArn;

            

Version Information

.NET Framework:
Supported in: 4.7.2 and newer

See Also