Class CfnDaemonTaskDefinitionPropsMixin.LogConfigurationProperty
The log configuration for the container.
Inherited Members
Namespace: Amazon.CDK.CfnPropertyMixins.AWS.ECS
Assembly: Amazon.CDK.CfnPropertyMixins.dll
Syntax (csharp)
public class CfnDaemonTaskDefinitionPropsMixin.LogConfigurationProperty : CfnDaemonTaskDefinitionPropsMixin.ILogConfigurationProperty
Syntax (vb)
Public Class CfnDaemonTaskDefinitionPropsMixin.LogConfigurationProperty Implements CfnDaemonTaskDefinitionPropsMixin.ILogConfigurationProperty
Remarks
This parameter maps to LogConfig in the docker container create command and the --log-driver option to docker run.
By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver configuration in the container definition.
Understand the following when specifying a log configuration for your containers.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.CfnPropertyMixins.AWS.ECS;
var logConfigurationProperty = new LogConfigurationProperty {
LogDriver = "logDriver",
Options = new Dictionary<string, string> {
{ "optionsKey", "options" }
},
SecretOptions = new [] { new SecretProperty {
Name = "name",
ValueFrom = "valueFrom"
} }
};
Synopsis
Constructors
| LogConfigurationProperty() | The log configuration for the container. |
Properties
| LogDriver | The log driver to use for the container. |
| Options | The configuration options to send to the log driver. |
| SecretOptions | The secrets to pass to the log configuration. |
Constructors
LogConfigurationProperty()
The log configuration for the container.
public LogConfigurationProperty()
Remarks
This parameter maps to LogConfig in the docker container create command and the --log-driver option to docker run.
By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver configuration in the container definition.
Understand the following when specifying a log configuration for your containers.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.CfnPropertyMixins.AWS.ECS;
var logConfigurationProperty = new LogConfigurationProperty {
LogDriver = "logDriver",
Options = new Dictionary<string, string> {
{ "optionsKey", "options" }
},
SecretOptions = new [] { new SecretProperty {
Name = "name",
ValueFrom = "valueFrom"
} }
};
Properties
LogDriver
The log driver to use for the container.
public string? LogDriver { get; set; }
Property Value
Remarks
For tasks on FARGATElong, the supported log drivers are awslogs, splunk, and awsfirelens.
For tasks hosted on Amazon EC2 instances, the supported log drivers are awslogs, fluentd, gelf, json-file, journald, syslog, splunk, and awsfirelens.
For more information about using the awslogs log driver, see Send Amazon ECS logs to CloudWatch in the Amazon Elastic Container Service Developer Guide.
For more information about using the awsfirelens log driver, see Send Amazon ECS logs to an service or Partner.
If you have a custom driver that isn't listed, you can fork the Amazon ECS container agent project that's available on GitHub and customize it to work with that driver. We encourage you to submit pull requests for changes that you would like to have included. However, we don't currently provide support for running modified copies of this software.
Options
The configuration options to send to the log driver.
public object? Options { get; set; }
Property Value
Remarks
The options you can specify depend on the log driver. Some of the options you can specify when you use the awslogs log driver to route logs to Amazon CloudWatch include the following:
Type union: either Dictionary<string, string> or IResolvable
SecretOptions
The secrets to pass to the log configuration.
public object? SecretOptions { get; set; }
Property Value
Remarks
For more information, see Specifying sensitive data in the Amazon Elastic Container Service Developer Guide.
Type union: either IResolvable or (either IResolvable or CfnDaemonTaskDefinitionPropsMixin.ISecretProperty)[]