services.x-logging ¶
services:
serviceA:
x-logging:
RetentionInDays: int
RetentionInDays ¶
Value to indicate how long should the logs be retained for the service.
Hint
If the value you enter is not in the allowed values, will set to the closest accepted value.
Hint
Emulates the CW Logs property RetentionInDays Property
FireLens ¶
FireLens is a configuration that will automatically generate the configuration for FluentBit to ship logs in the appropriate destinations configured.
We recommend the Rendered configuration which works for AWS Fargate, EC2 and ECS Anywhere.
Rendered ¶
Hint
We recommend to use that option as it will work in all compute platforms.
s3FileConfiguration ¶
Note
Only works when deploying to AWS ECS on EC2 instances.
Examples ¶
services:
serviceA:
x-logging:
RetentionInDays: 42
Hint
The following parameter is identical in behaviour to x-aws-logs_retention defined in the docker ECS Plugin.
Note
Alternatively you can use the ECS Plugin logging definition will ECS Compose-X will use. If both are defined, priority goes to the highest value.
JSON Schema ¶
Model ¶
services.x-logging specification ¶
services.x-logging |
|||||
The services.x-logging specification for ComposeX |
|||||
type |
object |
||||
properties |
|||||
|
|||||
type |
integer |
||||
|
Define options to configure FireLens and FluentBit accordingly |
||||
type |
object |
||||
properties |
|||||
|
#/definitions/FireLensShorthands |
||||
|
#/definitions/FireLensAdvancedConfig |
||||
additionalProperties |
False |
||||
additionalProperties |
False |
||||
definitions |
|||||
|
type |
object |
|||
properties |
|||||
|
If set to true, will use FireLens with CloudWatch logs instead of awslogs driver |
||||
type |
boolean |
||||
default |
False |
||||
|
#/definitions/FirelensConfiguration |
||||
additionalProperties |
False |
||||
|
|||||
type |
object |
||||
properties |
|||||
|
Which fluent to use. FluentD only works when using FireLensService. |
||||
type |
string |
||||
enum |
fluentbit, fluentd |
||||
default |
fluentbit |
||||
|
type |
object |
|||
properties |
|||||
|
type |
boolean |
|||
default |
True |
||||
|
type |
string |
|||
enum |
file, s3 |
||||
|
type |
string |
|||
additionalProperties |
False |
||||
dependencies |
|||||
|
|||||
additionalProperties |
False |
||||
|
type |
object |
|||
properties |
|||||
|
Docker image to use instead of the AWS-fluentbit image |
||||
type |
string |
||||
|
Amount in bytes, of RAM to assign to the FireLens container to cater for BufferLimit. |
||||
type |
number |
||||
minimum |
33554432 |
||||
default |
67108864 |
||||
|
Customizable CPU Limit for the sidecar container. |
||||
type |
number |
||||
minimum |
0.1 |
||||
default |
0.1 |
||||
|
#/definitions/FirelensConfiguration |
||||
|
Path to the source file that contains the configuration |
||||
type |
string |
||||
|
List of files to use to add via the config sidecar |
||||
type |
array |
||||
items |
Path to the files to add as ParserFiles |
||||
type |
string |
||||
minItems |
1 |
||||
|
Automatically adds API based healthcheck for fluentbit instead of nc based. |
||||
type |
boolean |
||||
default |
True |
||||
|
Time in seconds for GRACE period before the container stops after receiving SIGTERM |
||||
type |
number |
||||
maximum |
120 |
||||
minimum |
5 |
||||
default |
30 |
||||
|
Generates automatically a new OUTPUT for a Compose-X managed resource |
||||
type |
array |
||||
items |
oneOf |
#/definitions/FireLensCloudWatchManagedDestination |
|||
#/definitions/FireLensFirehoseManagedDestination |
|||||
#/definitions/FireLensKinesisManagedDestination |
|||||
uniqueItems |
True |
||||
|
#/definitions/RenderEnvVars |
||||
additionalProperties |
False |
||||
|
Allows to setup all settings for OUTPUT https://docs.fluentbit.io/manual/pipeline/outputs/firehose |
||||
type |
object |
||||
properties |
|||||
|
Define delivery_stream with simple name or a delivery stream defined in x-kinesis_firehose. |
||||
type |
string |
||||
additionalProperties |
True |
||||
|
type |
object |
|||
properties |
|||||
|
Define delivery_stream with simple name or a data stream defined in x-kinesis. |
||||
type |
string |
||||
|
Allows to define all settings for OUTPUT https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch |
||||
type |
object |
||||
properties |
|||||
|
Value for log_group_name from the original plugin. |
||||
type |
string |
||||
|
Allows to specify extra environment variables to the firelens container |
||||
type |
object |
||||
patternProperties |
|||||
|
oneOf |
type |
string |
||
Allows to use CFN Ref or Sub functions directly |
|||||
type |
object |
||||
properties |
|||||
|
type |
string |
|||
|
type |
string |
|||
additionalProperties |
False |
Definition ¶
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "services.x-logging.spec.json",
"id": "services.x-logging",
"type": "object",
"title": "services.x-logging specification",
"description": "The services.x-logging specification for ComposeX",
"additionalProperties": false,
"properties": {
"RetentionInDays": {
"type": "integer",
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-retentionindays"
},
"FireLens": {
"type": "object",
"additionalProperties": false,
"description": "Define options to configure FireLens and FluentBit accordingly",
"oneOf": [
{
"required": [
"Shorthands"
]
},
{
"required": [
"Advanced"
]
}
],
"properties": {
"Shorthands": {
"$ref": "#/definitions/FireLensShorthands"
},
"Advanced": {
"$ref": "#/definitions/FireLensAdvancedConfig"
}
}
}
},
"definitions": {
"FireLensShorthands": {
"type": "object",
"additionalProperties": false,
"properties": {
"ReplaceAwsLogs": {
"type": "boolean",
"default": false,
"description": "If set to true, will use FireLens with CloudWatch logs instead of awslogs driver"
},
"FirelensConfiguration": {
"$ref": "#/definitions/FirelensConfiguration"
}
}
},
"FirelensConfiguration": {
"type": "object",
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-firelensconfiguration.html",
"additionalProperties": false,
"properties": {
"Type": {
"type": "string",
"description": "Which fluent to use. FluentD only works when using FireLensService.",
"default": "fluentbit",
"enum": [
"fluentbit",
"fluentd"
]
},
"Options": {
"type": "object",
"additionalProperties": false,
"dependencies": {
"config-file-type": {
"required": [
"config-file-value"
]
}
},
"properties": {
"enable-ecs-log-metadata": {
"type": "boolean",
"default": true
},
"config-file-type": {
"type": "string",
"enum": [
"file",
"s3"
]
},
"config-file-value": {
"type": "string"
}
}
}
}
},
"FireLensAdvancedConfig": {
"type": "object",
"additionalProperties": false,
"properties": {
"DockerImageOverride": {
"type": "string",
"description": "Docker image to use instead of the AWS-fluentbit image"
},
"LogDriverBufferLimit": {
"type": "number",
"minimum": 33554432,
"default": 67108864,
"description": "Amount in bytes, of RAM to assign to the FireLens container to cater for BufferLimit."
},
"SidecarCpuReservation": {
"type": "number",
"minimum": 0.1,
"description": "Customizable CPU Limit for the sidecar container.",
"default": 0.1
},
"FirelensConfiguration": {
"$ref": "#/definitions/FirelensConfiguration"
},
"SourceFile": {
"type": "string",
"description": "Path to the source file that contains the configuration"
},
"ParserFiles": {
"type": "array",
"minItems": 1,
"description": "List of files to use to add via the config sidecar",
"items": {
"type": "string",
"description": "Path to the files to add as ParserFiles"
}
},
"EnableApiHeathCheck": {
"type": "boolean",
"default": true,
"description": "Automatically adds API based healthcheck for fluentbit instead of nc based."
},
"GracePeriod": {
"type": "number",
"minimum": 5,
"maximum": 120,
"default": 30,
"description": "Time in seconds for GRACE period before the container stops after receiving SIGTERM"
},
"ComposeXManagedAwsDestinations": {
"type": "array",
"uniqueItems": true,
"description": "Generates automatically a new OUTPUT for a Compose-X managed resource",
"items": {
"oneOf": [
{
"$ref": "#/definitions/FireLensCloudWatchManagedDestination"
},
{
"$ref": "#/definitions/FireLensFirehoseManagedDestination"
},
{
"$ref": "#/definitions/FireLensKinesisManagedDestination"
}
]
}
},
"EnvironmentVariables": {
"$ref": "#/definitions/RenderEnvVars"
}
}
},
"FireLensFirehoseManagedDestination": {
"type": "object",
"required": [
"delivery_stream"
],
"description": "Allows to setup all settings for OUTPUT https://docs.fluentbit.io/manual/pipeline/outputs/firehose",
"additionalProperties": true,
"properties": {
"delivery_stream": {
"type": "string",
"description": "Define delivery_stream with simple name or a delivery stream defined in x-kinesis_firehose."
}
}
},
"FireLensKinesisManagedDestination": {
"type": "object",
"required": ["stream"],
"properties": {
"stream": {
"type": "string",
"description": "Define delivery_stream with simple name or a data stream defined in x-kinesis."
}
}
},
"FireLensCloudWatchManagedDestination": {
"type": "object",
"description": "Allows to define all settings for OUTPUT https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch",
"required": [
"log_group_name"
],
"properties": {
"log_group_name": {
"type": "string",
"description": "Value for log_group_name from the original plugin."
}
}
},
"RenderEnvVars": {
"type": "object",
"description": "Allows to specify extra environment variables to the firelens container",
"patternProperties": {
"^[a-zA-Z\\d._-]+$": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"description": "Allows to use CFN Ref or Sub functions directly",
"properties": {
"Fn::Sub": {
"type": "string"
},
"Fn::Ref": {
"type": "string"
}
},
"oneOf": [
{
"required": [
"Fn::Ref"
]
},
{
"required": [
"Fn::Sub"
]
}
]
}
]
}
}
}
}
}