Skip to content
v2.274.0

LoggingFormat Class ​

Configuration for Envoy Access Logging Format for mesh endpoints.

Example ​

ts
declare const mesh: appmesh.Mesh;
declare const service: cloudmap.Service;
const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 8080,
    healthCheck: appmesh.HealthCheck.http({
      healthyThreshold: 3,
      interval: cdk.Duration.seconds(5),
      path: '/ping',
      timeout: cdk.Duration.seconds(2),
      unhealthyThreshold: 2,
    }),
    timeout: {
      idle: cdk.Duration.seconds(5),
    },
  })],
  backendDefaults: {
    tlsClientPolicy: {
      validation: {
        trust: appmesh.TlsValidationTrust.file('/keys/local_cert_chain.pem'),
      },
    },
  },
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout',
    appmesh.LoggingFormat.fromJson(
      {testKey1: 'testValue1', testKey2: 'testValue2'})),
});

Initializer ​

ts
new LoggingFormat()
python
LoggingFormat()
java
new LoggingFormat()
csharp
new LoggingFormat()
go
NewLoggingFormat()

Methods ​

bind(): LoggingFormatConfigdef bind(self, ) -> LoggingFormatConfigpublic LoggingFormatConfig bind()public LoggingFormatConfig Bind()func Bind() LoggingFormatConfig#
Called when the Access Log Format is initialized.

Can be used to enforce mutual exclusivity with future properties

fromJson(jsonLoggingFormat: { [key: string]: string }): LoggingFormat // chainable@staticmethod def from_json(json_logging_format: typing.Mapping[str, str]) -> LoggingFormatpublic static LoggingFormat fromJson(Map<String, String> jsonLoggingFormat)public static LoggingFormat FromJson(IDictionary<string, string> jsonLoggingFormat)func FromJson(JsonLoggingFormat *map[string]*string) LoggingFormatstatic#
Generate logging format from json key pairs.
fromText(text: string): LoggingFormat // chainable@staticmethod def from_text(text: str) -> LoggingFormatpublic static LoggingFormat fromText(String text)public static LoggingFormat FromText(string text)func FromText(Text *string) LoggingFormatstatic#
Generate logging format from text pattern.