Fugue.AWS.ECS.LogConfiguration

Module Members

awslogs

(Function)

Setup the awslogs logging driver for Docker.

See https://docs.docker.com/engine/admin/logging/overview/#awslogs for full details.

Example usage:

awslogs: ECS.LogConfiguration.awslogs {
  awslogsRegion: AWS.Us-west-2,
  awslogsGroup: "myLogGroup",
  awslogsCreateGroup: True,
}

Type Signature

 fun { awslogsRegion: Optional<Region>,
       awslogsGroup: String,
       awslogsStreamPrefix: Optional<String>,
       awslogsCreateGroup: Optional<Bool> } -> LogConfiguration
Argument: awslogsRegion

The awslogs logging driver sends your Docker logs to a specific region. Use the awslogs-region log option or the AWS_REGION environment variable to set the region. By default, if your Docker daemon is running on an EC2 instance and no region is set, the driver uses the instance’s region.

Type: Optional<Region>

Argument: awslogsGroup

You must specify a log group for the awslogs logging driver.

Type: String

Argument: awslogsStreamPrefix
Type: Optional<String>
Argument: awslogsCreateGroup

Log driver returns an error by default if the log group does not exist. However, you can set the awslogs-create-group to true to automatically create the log group as needed. The awslogs-create-group option defaults to false.

Type: Optional<Bool>

Returns:
Type: LogConfiguration

fluentd

(Function)

Setup the fluentd logging driver for Docker.

See https://docs.docker.com/engine/admin/logging/overview/#fluentd for full details.

Example usage:

fluentd: ECS.LogConfiguration.fluentd {
  fluentdAddress: "udp://192.168.0.42:12201",
}

Type Signature

 fun { fluentdAddress: Optional<String>,
       fluentdBufferLimit: Optional<String>,
       fluentdRetryWait: Optional<String>,
       fluentdMaxRetries: Optional<Int>,
       fluentdAsyncConnect: Optional<Bool>,
       fluentdSubSecondPrecision: Optional<Bool>,
       tag: Optional<String>,
       labels: Optional<String>,
       env: Optional<String>,
       envRegex: Optional<String> } -> LogConfiguration
Argument: fluentdAddress

By default, the logging driver connects to localhost:24224. Supply the fluentd-address option to connect to a different address. tcp(default) and unix sockets are supported.

Type: Optional<String>

Argument: fluentdBufferLimit

The amount of data to buffer before flushing to disk. Defaults to the amount of RAM available to the container.

Type: Optional<String>

Argument: fluentdRetryWait

How long to wait between retries. Defaults to 1 second.

Type: Optional<String>

Argument: fluentdMaxRetries

The maximum number of retries. Defaults to 10.

Type: Optional<Int>

Argument: fluentdAsyncConnect

Docker connects to Fluentd in the background. Messages are buffered until the connection is established.

Type: Optional<Bool>

Argument: fluentdSubSecondPrecision

Generates event logs in nanosecond resolution. Defaults to false.

Type: Optional<Bool>

Argument: tag

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.

Type: Optional<String>

Argument: labels

Applies when starting the Docker daemon. A comma-separated list of logging-related labels this daemon accepts.

Type: Optional<String>

Argument: env

Applies when starting the Docker daemon. A comma-separated list of logging-related environment variables this daemon accepts.

Type: Optional<String>

Argument: envRegex

Similar to and compatible with env. A regular expression to match logging-related environment variables.

Type: Optional<String>

Returns:

An LogConfiguration using the fluentd logging driver.

Type: LogConfiguration

gelf

(Function)

Setup the gelf logging driver for Docker.

See https://docs.docker.com/engine/admin/logging/overview/#gelf for full details.

Example usage:

gelf: ECS.LogConfiguration.gelf {
  gelfAddress: "udp://192.168.0.42:12201",
}

Type Signature

 fun { gelfAddress: Optional<String>,
       gelfCompressionType: Optional<String>,
       gelfCompressionLevel: Optional<Int>,
       gelfTcpMaxReconnect: Optional<Int>,
       gelfTcpReconnectDelay: Optional<Int>,
       tag: Optional<String>,
       labels: Optional<String>,
       env: Optional<String>,
       envRegex: Optional<String> } -> LogConfiguration
Argument: gelfAddress

The address of the GELF server. tcp and udp are the only supported URI specifier and you must specify the port.

Type: Optional<String>

Argument: gelfCompressionType

UDP Only The type of compression the GELF driver uses to compress each log message. Allowed values are gzip, zlib and none. The default is gzip.

Type: Optional<String>

Argument: gelfCompressionLevel

UDP Only The level of compression when gzip or zlib is the gelf-compression-type. An integer in the range of -1 to 9 (BestCompression). Default value is 1 (BestSpeed). Higher levels provide more compression at lower speed. Either -1 or 0 disables compression.

Type: Optional<Int>

Argument: gelfTcpMaxReconnect

TCP Only The maximum number of reconnection attempts when the connection drop. An positive integer. Default value is 3.

Type: Optional<Int>

Argument: gelfTcpReconnectDelay
Type: Optional<Int>
Argument: tag

A string that is appended to the APP-NAME in the gelf message. 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.

Type: Optional<String>

Argument: labels

Applies when starting the Docker daemon. A comma-separated list of logging-related labels this daemon accepts.

Type: Optional<String>

Argument: env

Applies when starting the Docker daemon. A comma-separated list of logging-related environment variables this daemon accepts.

Type: Optional<String>

Argument: envRegex

Similar to and compatible with env. A regular expression to match logging-related environment variables.

Type: Optional<String>

Returns:

An LogConfiguration using the gelf logging driver.

Type: LogConfiguration

journald

(Function)

Setup the journald logging driver for Docker.

See https://docs.docker.com/engine/admin/logging/overview/#journald for full details.

Example usage:

journald: ECS.LogConfiguration.journald {}

Type Signature

 fun { tag: Optional<String>,
       label: Optional<String>,
       env: Optional<String>,
       envRegex: Optional<String> } -> LogConfiguration
Argument: tag

Specify template to set CONTAINER_TAG and SYSLOG_IDENTIFIER value in journald logs.

Type: Optional<String>

Argument: label

Comma-separated list of keys of labels, which should be included in message, if these labels are specified for the container.

Type: Optional<String>

Argument: env

Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for the container.

Type: Optional<String>

Argument: envRegex

Similar to and compatible with env. A regular expression to match logging-related environment variables.

Type: Optional<String>

Returns:

An LogConfiguration using the journald logging driver.

Type: LogConfiguration

jsonFile

(Function)

Setup the json-file logging driver for Docker.

See https://docs.docker.com/engine/admin/logging/overview/#json-file for full details.

Example Usage:

jsonLogs: ECS.LogConfiguration.jsonFile {
  maxSize: "10m",
  maxFile: 3,
}

Type Signature

 fun { maxSize: Optional<String>,
       maxFile: Optional<Int>,
       labels: Optional<String>,
       env: Optional<String>,
       envRegex: Optional<String> } -> LogConfiguration
Argument: maxSize

The maximum size of the log before it is rotated. Must be a positive integer with unit suffix (k, m, or g).

Type: Optional<String>

Argument: maxFile

The maximum number of log files to keep. The oldest files will be removed when rotating. Requires maxSize to be specified.

Type: Optional<Int>

Argument: labels

Applies when starting the Docker daemon. A comma-separated list of logging-related labels this daemon accepts.

Type: Optional<String>

Argument: env

Applies when starting the Docker daemon. A comma-separated list of logging-related environment variables this daemon accepts.

Type: Optional<String>

Argument: envRegex

Similar to and compatible with env. A regular expression to match logging-related environment variables.

Type: Optional<String>

Returns:

An LogConfiguration using the json-file logging driver.

Type: LogConfiguration

syslog

(Function)

Setup the syslog logging driver for Docker.

See https://docs.docker.com/engine/admin/logging/overview/#json-file for full details.

Example Usage:

syslog: ECS.LogConfiguration.syslog {
  syslogAddress: "tcp://192.168.0.42:123",
  syslogFacility: "daemon",
}

syslogWithTls: ECS.LogConfiguration.syslog {
  syslogAddress: "tcp+tls://192.168.0.42:123",
  syslogTlsCaCert: "/etc/ca-certificates/custom/ca.pem",
  syslogTlsCert: "/etc/ca-certificates/custom/cert.pem",
  syslogTlsKey: "/etc/ca-certificates/custom/key.pem",
}

Type Signature

 fun { syslogAddress: Optional<String>,
       syslogFacility: Optional<String>,
       syslogTlsCaCert: Optional<String>,
       syslogTlsCert: Optional<String>,
       syslogTlsKey: Optional<String>,
       syslogTlsSkipVerify: Optional<Bool>,
       tag: Optional<String>,
       syslogFormat: Optional<String>,
       labels: Optional<String>,
       env: Optional<String>,
       envRegex: Optional<String> } -> LogConfiguration
Argument: syslogAddress

The address of an external syslog server.

Type: Optional<String>

Argument: syslogFacility

The syslog facility to use. Can be the number or name for any valid syslog facility.

Type: Optional<String>

Argument: syslogTlsCaCert

The absolute path to the trust certificates signed by the CA. Ignored if the address protocol is not tcp+tls.

Type: Optional<String>

Argument: syslogTlsCert

The absolute path to the TLS certificate file. Ignored if the address protocol is not tcp+tls.

Type: Optional<String>

Argument: syslogTlsKey

The absolute path to the TLS key file. Ignored if the address protocol is not tcp+tls.

Type: Optional<String>

Argument: syslogTlsSkipVerify

If set to true, TLS verification is skipped when connecting to the syslog daemon. Defaults to false. Ignored if the address protocol is not tcp+tls.

Type: Optional<Bool>

Argument: tag

A string that is appended to the APP-NAME in the syslog message. By default, Docker uses the first 12 characters of the container ID to tag log messages.

Type: Optional<String>

Argument: syslogFormat
Type: Optional<String>
Argument: labels

Applies when starting the Docker daemon. A comma-separated list of logging-related labels this daemon accepts.

Type: Optional<String>

Argument: env

Applies when starting the Docker daemon. A comma-separated list of logging-related environment variables this daemon accepts.

Type: Optional<String>

Argument: envRegex

Similar to and compatible with env. A regular expression to match logging-related environment variables.

Type: Optional<String>

Returns:

An LogConfiguration using the syslog logging driver.

Type: LogConfiguration