Interface JsonWithStandardFieldProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
JsonWithStandardFieldProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-21T06:34:02.609Z") @Stability(Stable) public interface JsonWithStandardFieldProps extends software.amazon.jsii.JsiiSerializable
Properties for controlling items output in JSON standard format.

Example:

 // production stage
 LogGroup prodLogGroup = new LogGroup(this, "PrdLogs");
 RestApi api = RestApi.Builder.create(this, "books")
         .deployOptions(StageOptions.builder()
                 .accessLogDestination(new LogGroupLogDestination(prodLogGroup))
                 .accessLogFormat(AccessLogFormat.jsonWithStandardFields())
                 .build())
         .build();
 Deployment deployment = Deployment.Builder.create(this, "Deployment").api(api).build();
 // development stage
 LogGroup devLogGroup = new LogGroup(this, "DevLogs");
 Stage.Builder.create(this, "dev")
         .deployment(deployment)
         .accessLogDestination(new LogGroupLogDestination(devLogGroup))
         .accessLogFormat(AccessLogFormat.jsonWithStandardFields(JsonWithStandardFieldProps.builder()
                 .caller(false)
                 .httpMethod(true)
                 .ip(true)
                 .protocol(true)
                 .requestTime(true)
                 .resourcePath(true)
                 .responseLength(true)
                 .status(true)
                 .user(true)
                 .build()))
         .build();
 
  • Method Details

    • getCaller

      @Stability(Stable) @NotNull Boolean getCaller()
      If this flag is enabled, the principal identifier of the caller will be output to the log.
    • getHttpMethod

      @Stability(Stable) @NotNull Boolean getHttpMethod()
      If this flag is enabled, the http method will be output to the log.
    • getIp

      @Stability(Stable) @NotNull Boolean getIp()
      If this flag is enabled, the source IP of request will be output to the log.
    • getProtocol

      @Stability(Stable) @NotNull Boolean getProtocol()
      If this flag is enabled, the request protocol will be output to the log.
    • getRequestTime

      @Stability(Stable) @NotNull Boolean getRequestTime()
      If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log.
    • getResourcePath

      @Stability(Stable) @NotNull Boolean getResourcePath()
      If this flag is enabled, the path to your resource will be output to the log.
    • getResponseLength

      @Stability(Stable) @NotNull Boolean getResponseLength()
      If this flag is enabled, the response payload length will be output to the log.
    • getStatus

      @Stability(Stable) @NotNull Boolean getStatus()
      If this flag is enabled, the method response status will be output to the log.
    • getUser

      @Stability(Stable) @NotNull Boolean getUser()
      If this flag is enabled, the principal identifier of the user will be output to the log.
    • builder

      @Stability(Stable) static JsonWithStandardFieldProps.Builder builder()
      Returns:
      a JsonWithStandardFieldProps.Builder of JsonWithStandardFieldProps