---
title: "Cycle.io Log Drains"
description: "Integrate Middleware with Cycle log drains to monitor logs, track errors, and improve system performance."
section: "Integrations"
breadcrumb: "Integrations > Hosting Platforms > Cycle.io Log Drains"
canonical: "https://docs.middleware.io/integrations/cycleio-log-drains"
---
# Cycle.io Log Drains

[cycle.io](https://cycle.io) HTTP/S log drains buffer log messages and submit batches of messages to an HTTPS endpoint via a POST request. The POST body contains [NDJSON](https://github.com/ndjson/ndjson-spec) formatted log messages.

Middleware’s HTTP API implements and understands the NDJSON formatted messages and can extract additional metadata sent by cycle.io in HTTP POST headers to enrich log messages.

## Steps

### 1 Navigate to Container Log Drains Configuration

Log in to your [cycle.io](https://portal.cycle.io) account and navigate to `Environments` > `<environment-name>` > `Containers` > `<container-name>` > `Config` > `Integrations`.

`<environment-name>` and `<container-name>` are the names of the cycle.io Environment and Container for which you want to configure Log Drains.

### 2 Enable Instance Logs Customization

Under `Integrations`, enable `Instance Logs Customization` integration option. The integration option will look like below

![advance multi step option](/images/cycleio-log-drains.png)

### 3 Configure Log Drain URL

Under `Drain URL`, enter the URL below

```
https://your-initial-id.middleware.io/v1/integrations/cycleio/logs?mw-api-key=your-initial-token
```

## Attribute Overrides

Middleware automatically extracts metadata from cycle.io log messages and adds following attributes. You can override these attributes by passing in relevant query parameters in the `Drain URL` as listed below

- **Service Name**: Use `service` query parameter to override `service.name` attribute for your log messages.
- **Application Name**: Use `app` query parameter to override `app.name` attribute for your log messages.
- **Source**: Use `source` query paratmer to override `source` attribute for your log messages.

Below is an example of the `Drain URL` with attribute overrides

```
https://your-initial-id.middleware.io/v1/integrations/cycleio/logs?mw-api-key=your-initial-token&service=my-service&app=my-app&source=my-source
```

## Custom attributes:

You can add custom attributes to your logs by passing additional query parameters in the `Drain URL` as follows:

```
https://your-initial-id.middleware.io/v1/integrations/cycleio/logs?mw-api-key=your-initial-token&my-attribute=my-value
```

In the above command, `my-attribute` in query parameter is the custom attribute and `my-value` is the value for that attribute.

> **Note:** Middleware platform limits the number of custom attributes to 50. This includes any of the attribute overrides mentioned in the previous section.
