interface JsonFileLogDriverProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ECS.JsonFileLogDriverProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#JsonFileLogDriverProps |
Java | software.amazon.awscdk.services.ecs.JsonFileLogDriverProps |
Python | aws_cdk.aws_ecs.JsonFileLogDriverProps |
TypeScript (source) | aws-cdk-lib » aws_ecs » JsonFileLogDriverProps |
Specifies the json-file log driver configuration options.
Example
// 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
Name | Type | Description |
---|---|---|
compress? | boolean | Toggles compression for rotated logs. |
env? | string[] | The env option takes an array of keys. |
env | string | The env-regex option is similar to and compatible with env. |
labels? | string[] | The labels option takes an array of keys. |
max | number | The maximum number of log files that can be present. |
max | string | The maximum size of the log before it is rolled. |
tag? | string | By default, Docker uses the first 12 characters of the container ID to tag log messages. |
compress?
Type:
boolean
(optional, default: false)
Toggles compression for rotated logs.
env?
Type:
string[]
(optional, default: 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.
envRegex?
Type:
string
(optional, default: 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.
labels?
Type:
string[]
(optional, default: 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.
maxFile?
Type:
number
(optional, default: 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.
maxSize?
Type:
string
(optional, default: -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).
tag?
Type:
string
(optional, default: The first 12 characters of the container ID)
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.