Class LoggingFormat
Configuration for Envoy Access Logging Format for mesh endpoints.
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class LoggingFormat : DeputyBase
Syntax (vb)
Public MustInherit Class LoggingFormat Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
Mesh mesh;
Service service;
var node = new VirtualNode(this, "node", new VirtualNodeProps {
Mesh = mesh,
ServiceDiscovery = ServiceDiscovery.CloudMap(service),
Listeners = new [] { VirtualNodeListener.Http(new HttpVirtualNodeListenerOptions {
Port = 8080,
HealthCheck = HealthCheck.Http(new HttpHealthCheckOptions {
HealthyThreshold = 3,
Interval = Duration.Seconds(5),
Path = "/ping",
Timeout = Duration.Seconds(2),
UnhealthyThreshold = 2
}),
Timeout = new HttpTimeout {
Idle = Duration.Seconds(5)
}
}) },
BackendDefaults = new BackendDefaults {
TlsClientPolicy = new TlsClientPolicy {
Validation = new TlsValidation {
Trust = TlsValidationTrust.File("/keys/local_cert_chain.pem")
}
}
},
AccessLog = AccessLog.FromFilePath("/dev/stdout", LoggingFormat.FromJson(new Dictionary<string, string> { { "testKey1", "testValue1" }, { "testKey2", "testValue2" } }))
});
Synopsis
Constructors
LoggingFormat() | Configuration for Envoy Access Logging Format for mesh endpoints. |
Methods
Bind() | Called when the Access Log Format is initialized. |
FromJson(IDictionary<string, string>) | Generate logging format from json key pairs. |
FromText(string) | Generate logging format from text pattern. |
Constructors
LoggingFormat()
Configuration for Envoy Access Logging Format for mesh endpoints.
protected LoggingFormat()
Remarks
ExampleMetadata: infused
Examples
Mesh mesh;
Service service;
var node = new VirtualNode(this, "node", new VirtualNodeProps {
Mesh = mesh,
ServiceDiscovery = ServiceDiscovery.CloudMap(service),
Listeners = new [] { VirtualNodeListener.Http(new HttpVirtualNodeListenerOptions {
Port = 8080,
HealthCheck = HealthCheck.Http(new HttpHealthCheckOptions {
HealthyThreshold = 3,
Interval = Duration.Seconds(5),
Path = "/ping",
Timeout = Duration.Seconds(2),
UnhealthyThreshold = 2
}),
Timeout = new HttpTimeout {
Idle = Duration.Seconds(5)
}
}) },
BackendDefaults = new BackendDefaults {
TlsClientPolicy = new TlsClientPolicy {
Validation = new TlsValidation {
Trust = TlsValidationTrust.File("/keys/local_cert_chain.pem")
}
}
},
AccessLog = AccessLog.FromFilePath("/dev/stdout", LoggingFormat.FromJson(new Dictionary<string, string> { { "testKey1", "testValue1" }, { "testKey2", "testValue2" } }))
});
Methods
Bind()
Called when the Access Log Format is initialized.
public abstract ILoggingFormatConfig Bind()
Returns
Remarks
Can be used to enforce mutual exclusivity with future properties
FromJson(IDictionary<string, string>)
Generate logging format from json key pairs.
public static LoggingFormat FromJson(IDictionary<string, string> jsonLoggingFormat)
Parameters
- jsonLoggingFormat IDictionary<string, string>
Returns
Remarks
ExampleMetadata: infused
FromText(string)
Generate logging format from text pattern.
public static LoggingFormat FromText(string text)
Parameters
- text string
Returns
Remarks
ExampleMetadata: infused