SyslogLogDriver
- class aws_cdk.aws_ecs.SyslogLogDriver(*, address=None, facility=None, format=None, tls_ca_cert=None, tls_cert=None, tls_key=None, tls_skip_verify=None, env=None, env_regex=None, labels=None, tag=None)
Bases:
LogDriver
A log driver that sends log information to syslog Logs.
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_ecs as ecs syslog_log_driver = ecs.SyslogLogDriver( address="address", env=["env"], env_regex="envRegex", facility="facility", format="format", labels=["labels"], tag="tag", tls_ca_cert="tlsCaCert", tls_cert="tlsCert", tls_key="tlsKey", tls_skip_verify=False )
Constructs a new instance of the SyslogLogDriver class.
- Parameters:
address (
Optional
[str
]) – The address of an external syslog server. The URI specifier may be [tcp|udp|tcp+tls]://host:port, unix://path, or unixgram://path. Default: - If the transport is tcp, udp, or tcp+tls, the default port is 514.facility (
Optional
[str
]) – The syslog facility to use. Can be the number or name for any valid syslog facility. See the syslog documentation: https://tools.ietf.org/html/rfc5424#section-6.2.1. Default: - facility not setformat (
Optional
[str
]) – The syslog message format to use. If not specified the local UNIX syslog format is used, without a specified hostname. Specify rfc3164 for the RFC-3164 compatible format, rfc5424 for RFC-5424 compatible format, or rfc5424micro for RFC-5424 compatible format with microsecond timestamp resolution. Default: - format not settls_ca_cert (
Optional
[str
]) – The absolute path to the trust certificates signed by the CA. Ignored if the address protocol is not tcp+tls. Default: - tlsCaCert not settls_cert (
Optional
[str
]) – The absolute path to the TLS certificate file. Ignored if the address protocol is not tcp+tls. Default: - tlsCert not settls_key (
Optional
[str
]) – The absolute path to the TLS key file. Ignored if the address protocol is not tcp+tls. Default: - tlsKey not settls_skip_verify (
Optional
[bool
]) – If set to true, TLS verification is skipped when connecting to the syslog daemon. Ignored if the address protocol is not tcp+tls. Default: - falseenv (
Optional
[Sequence
[str
]]) – 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. Default: - No envenv_regex (
Optional
[str
]) – 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. Default: - No envRegexlabels (
Optional
[Sequence
[str
]]) – 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. Default: - No labelstag (
Optional
[str
]) – 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: - The first 12 characters of the container ID
Methods
- bind(_scope, _container_definition)
Called when the log driver is configured on a container.
- Parameters:
_scope (
Construct
) –_container_definition (
ContainerDefinition
) –
- Return type:
Static Methods
- classmethod aws_logs(*, stream_prefix, datetime_format=None, log_group=None, log_retention=None, max_buffer_size=None, mode=None, multiline_pattern=None)
Creates a log driver configuration that sends log information to CloudWatch Logs.
- Parameters:
stream_prefix (
str
) – Prefix for the log streams. The awslogs-stream-prefix option allows you to associate a log stream with the specified prefix, the container name, and the ID of the Amazon ECS task to which the container belongs. If you specify a prefix with this option, then the log stream takes the following format:: prefix-name/container-name/ecs-task-iddatetime_format (
Optional
[str
]) – This option defines a multiline start pattern in Python strftime format. A log message consists of a line that matches the pattern and any following lines that don’t match the pattern. Thus the matched line is the delimiter between log messages. Default: - No multiline matching.log_group (
Optional
[ILogGroup
]) – The log group to log to. Default: - A log group is automatically created.log_retention (
Optional
[RetentionDays
]) – The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct. Default: - Logs never expire.max_buffer_size (
Optional
[Size
]) – When AwsLogDriverMode.NON_BLOCKING is configured, this parameter controls the size of the non-blocking buffer used to temporarily store messages. This parameter is not valid with AwsLogDriverMode.BLOCKING. Default: - 1 megabyte if driver mode is non-blocking, otherwise this property is not setmode (
Optional
[AwsLogDriverMode
]) – The delivery mode of log messages from the container to awslogs. Default: - AwsLogDriverMode.BLOCKINGmultiline_pattern (
Optional
[str
]) – This option defines a multiline start pattern using a regular expression. A log message consists of a line that matches the pattern and any following lines that don’t match the pattern. Thus the matched line is the delimiter between log messages. This option is ignored if datetimeFormat is also configured. Default: - No multiline matching.
- Return type: