Skip to content
v2.273.0

JsonFileLogDriverProps Struct ​

Specifies the json-file log driver configuration options.

Source

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const jsonFileLogDriverProps: ecs.JsonFileLogDriverProps = {
  compress: false,
  env: ['env'],
  envRegex: 'envRegex',
  labels: ['labels'],
  maxFile: 123,
  maxSize: 'maxSize',
  tag: 'tag',
};

Properties ​

compressbooleancompressboolcompressBooleanCompressboolCompress*bool= false#
Toggles compression for rotated logs.
envstring[]envtyping.List[str]envList<String>Envstring[]Env*[]*string= No env#
The env option takes an array of keys.

If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.

envRegexstringenv_regexstrenvRegexStringEnvRegexstringEnvRegex*string= No envRegex#
The env-regex option is similar to and compatible with env.

Its value is a regular expression to match logging-related environment variables. It is used for advanced log tag options.

labelsstring[]labelstyping.List[str]labelsList<String>Labelsstring[]Labels*[]*string= No labels#
The labels option takes an array of keys.

If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.

maxFilenumbermax_fileint | floatmaxFileNumberMaxFiledoubleMaxFile*float64= 1#
The maximum number of log files that can be present.

If rolling the logs creates excess files, the oldest file is removed. Only effective when max-size is also set. A positive integer.

maxSizestringmax_sizestrmaxSizeStringMaxSizestringMaxSize*string= -1 (unlimited)#
The maximum size of the log before it is rolled.

A positive integer plus a modifier representing the unit of measure (k, m, or g).

tagstringtagstrtagStringTagstringTag*string= The first 12 characters of the c…#
By default, Docker uses the first 12 characters of the container ID to tag log messages.

Refer to the log tag option documentation for customizing the log tag format.

default

Default: The first 12 characters of the container ID

Used as props by ​