Interface IJsonWithStandardFieldProps
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
Properties for controlling items output in JSON standard format.
public interface IJsonWithStandardFieldProps
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
Properties
Caller
If this flag is enabled, the principal identifier of the caller will be output to the log.
bool Caller { get; }
Property Value
HttpMethod
If this flag is enabled, the http method will be output to the log.
bool HttpMethod { get; }
Property Value
Ip
If this flag is enabled, the source IP of request will be output to the log.
bool Ip { get; }
Property Value
Protocol
If this flag is enabled, the request protocol will be output to the log.
bool Protocol { get; }
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.
bool RequestTime { get; }
Property Value
ResourcePath
If this flag is enabled, the path to your resource will be output to the log.
bool ResourcePath { get; }
Property Value
ResponseLength
If this flag is enabled, the response payload length will be output to the log.
bool ResponseLength { get; }
Property Value
Status
If this flag is enabled, the method response status will be output to the log.
bool Status { get; }
Property Value
User
If this flag is enabled, the principal identifier of the user will be output to the log.
bool User { get; }