Class AccessLogFormat
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.apigateway.AccessLogFormat
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:44.686Z")
@Stability(Stable)
public class AccessLogFormat
extends software.amazon.jsii.JsiiObject
factory methods for access log format.
Example:
LogGroup logGroup = new LogGroup(this, "ApiGatewayAccessLogs");
RestApi.Builder.create(this, "books")
.deployOptions(StageOptions.builder()
.accessLogDestination(new LogGroupLogDestination(logGroup))
.accessLogFormat(AccessLogFormat.custom(String.format("%s %s %s", AccessLogField.contextRequestId(), AccessLogField.contextErrorMessage(), AccessLogField.contextErrorMessageString())))
.build())
.build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAccessLogFormat(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedAccessLogFormat(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessLogFormatclf()Generate Common Log Format.static AccessLogFormatCustom log format.static AccessLogFormatAccess log will be produced in the JSON format with a set of fields most useful in the access log.static AccessLogFormatAccess log will be produced in the JSON format with a set of fields most useful in the access log.toString()Output a format string to be used with CloudFormation.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
AccessLogFormat
protected AccessLogFormat(software.amazon.jsii.JsiiObjectRef objRef) -
AccessLogFormat
protected AccessLogFormat(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
clf
Generate Common Log Format. -
custom
Custom log format.You can create any log format string. You can easily get the $ context variable by using the methods of AccessLogField.
Example:
AccessLogFormat.custom(JSON.stringify(Map.of( "requestId", AccessLogField.contextRequestId(), "sourceIp", AccessLogField.contextIdentitySourceIp(), "method", AccessLogField.contextHttpMethod(), "userContext", Map.of( "sub", AccessLogField.contextAuthorizerClaims("sub"), "email", AccessLogField.contextAuthorizerClaims("email")))));- Parameters:
format- This parameter is required.
-
jsonWithStandardFields
@Stability(Stable) @NotNull public static AccessLogFormat jsonWithStandardFields(@Nullable JsonWithStandardFieldProps fields) Access log will be produced in the JSON format with a set of fields most useful in the access log.All fields are turned on by default with the option to turn off specific fields.
- Parameters:
fields-
-
jsonWithStandardFields
Access log will be produced in the JSON format with a set of fields most useful in the access log.All fields are turned on by default with the option to turn off specific fields.
-
toString
Output a format string to be used with CloudFormation.
-