Guides
Integrations
Logging with Firelens

Logging with Firelens

AWS Firelens is a log driver for ECS that increases your control over log routing and storage. A typical use case for Firelens is to route logs to a third-party service, such as Datadog. See the web service type docs for specific configuration information.

Firelens uses Fluent Bit (opens in a new tab) plugins for sending logs to other services. This is an open source tool that contains a number of third party output plugins (opens in a new tab) that can be used with Firelens. After configuring the third-party service, you can use the following templates to route logs to the service.

44+ Integrations

You can route logs to any Fluent Bit output plugin (opens in a new tab).

Configuration for common examples are listed here for easy reference:

Datadog Example

Add the following logging and envVariables fields in your Flightcontrol service config. Be sure to replace the values with the specific values for your Datadog instances.

See the Datadog documentation (opens in a new tab) for more information.

{
  "logging": {
    "ecsLogsMetadataEnabled": true,
    "firelensOptions": [
      {
        "name": "datadog",
        "match": "*",
        "options": {
          "apikey": "${DATADOG_API_KEY}",
          "Host": "http-intake.logs.us5.datadoghq.com",
          "dd_service": "service name in Datadog",
          "dd_source": "optional",
          "dd_tags": "optional",
          "TLS": "on",
          "provider": "ecs"
        }
      }
    ],
    "envVariables": {
      "DATADOG_API_KEY": {
        "fromParameterStore": "/datadog/api"
      }
    }
  }
}