Class JsonWithStandardFieldProps
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
Properties for controlling items output in JSON standard format.
public class JsonWithStandardFieldProps : IJsonWithStandardFieldProps
- Inheritance
-
JsonWithStandardFieldProps
- Implements
- Inherited Members
Examples
// production stage
var prdLogGroup = new LogGroup(this, "PrdLogs");
var api = new RestApi(this, "books", new RestApiProps {
DeployOptions = new StageOptions {
AccessLogDestination = new LogGroupLogDestination(prdLogGroup),
AccessLogFormat = AccessLogFormat.JsonWithStandardFields()
}
});
var deployment = new Deployment(this, "Deployment", new DeploymentProps { Api = api });
// development stage
var devLogGroup = new LogGroup(this, "DevLogs");
new Stage(this, "dev", new StageProps {
Deployment = deployment,
AccessLogDestination = new LogGroupLogDestination(devLogGroup),
AccessLogFormat = AccessLogFormat.JsonWithStandardFields(new JsonWithStandardFieldProps {
Caller = false,
HttpMethod = true,
Ip = true,
Protocol = true,
RequestTime = true,
ResourcePath = true,
ResponseLength = true,
Status = true,
User = true
})
});
Remarks
ExampleMetadata: infused
Constructors
JsonWithStandardFieldProps()
public JsonWithStandardFieldProps()
Properties
Caller
If this flag is enabled, the principal identifier of the caller will be output to the log.
public bool Caller { get; set; }
Property Value
HttpMethod
If this flag is enabled, the http method will be output to the log.
public bool HttpMethod { get; set; }
Property Value
Ip
If this flag is enabled, the source IP of request will be output to the log.
public bool Ip { get; set; }
Property Value
Protocol
If this flag is enabled, the request protocol will be output to the log.
public bool Protocol { get; set; }
Property Value
RequestTime
If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log.
public bool RequestTime { get; set; }
Property Value
ResourcePath
If this flag is enabled, the path to your resource will be output to the log.
public bool ResourcePath { get; set; }
Property Value
ResponseLength
If this flag is enabled, the response payload length will be output to the log.
public bool ResponseLength { get; set; }
Property Value
Status
If this flag is enabled, the method response status will be output to the log.
public bool Status { get; set; }
Property Value
User
If this flag is enabled, the principal identifier of the user will be output to the log.
public bool User { get; set; }