Interface IJsonWithStandardFieldProps
Properties for controlling items output in JSON standard format.
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IJsonWithStandardFieldProps
Syntax (vb)
Public Interface IJsonWithStandardFieldProps
Remarks
ExampleMetadata: infused
Examples
// production stage
var prodLogGroup = new LogGroup(this, "PrdLogs");
var api = new RestApi(this, "books", new RestApiProps {
DeployOptions = new StageOptions {
AccessLogDestination = new LogGroupLogDestination(prodLogGroup),
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
})
});
Synopsis
Properties
Caller | If this flag is enabled, the principal identifier of the caller will be output to the log. |
HttpMethod | If this flag is enabled, the http method will be output to the log. |
Ip | If this flag is enabled, the source IP of request will be output to the log. |
Protocol | If this flag is enabled, the request protocol will be output to the log. |
RequestTime | If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log. |
ResourcePath | If this flag is enabled, the path to your resource will be output to the log. |
ResponseLength | If this flag is enabled, the response payload length will be output to the log. |
Status | If this flag is enabled, the method response status will be output to the log. |
User | If this flag is enabled, the principal identifier of the user will be output to the log. |
Properties
Caller
If this flag is enabled, the principal identifier of the caller will be output to the log.
bool Caller { get; }
Property Value
System.Boolean
HttpMethod
If this flag is enabled, the http method will be output to the log.
bool HttpMethod { get; }
Property Value
System.Boolean
Ip
If this flag is enabled, the source IP of request will be output to the log.
bool Ip { get; }
Property Value
System.Boolean
Protocol
If this flag is enabled, the request protocol will be output to the log.
bool Protocol { get; }
Property Value
System.Boolean
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
System.Boolean
ResourcePath
If this flag is enabled, the path to your resource will be output to the log.
bool ResourcePath { get; }
Property Value
System.Boolean
ResponseLength
If this flag is enabled, the response payload length will be output to the log.
bool ResponseLength { get; }
Property Value
System.Boolean
Status
If this flag is enabled, the method response status will be output to the log.
bool Status { get; }
Property Value
System.Boolean
User
If this flag is enabled, the principal identifier of the user will be output to the log.
bool User { get; }
Property Value
System.Boolean