> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Logz.io

> Configure log shipping from Control Plane to Logz.io for observability with AI-powered log analysis and real-time visualization.

## Overview

[Logz.io](https://www.logz.io) is a comprehensive observability platform that provides better visibility into
applications and systems.

The fully managed SaaS solution allows you to collect, parse, and analyze logs, metrics, traces, and security data in one place, using AI and machine learning to help identify and resolve issues, respond faster to incidents, and manage costs effectively.

With [Logz.io](https://www.logz.io), you can aggregate and visualize your server log data in real-time, making it easier understanding the events happening across your infrastructure easier.

[Logz.io](https://www.logz.io) supports long-term log retention and is built with security in mind, providing features like role-based access control, ensuring that your sensitive log data is properly protected.

Follow the steps below to configure shipping data from Control Plane to [Logz.io](https://www.logz.io):

## Step 1 - Generate Token Credentials

[Logz.io](https://www.logz.io) requires an authorization token in order to process data and logs. You’ll need to store the token as an [Opaque Secret](/reference/secret#opaque) and configure external logging.

1. Log into your [Logz.io](https://www.logz.io) account and open the [Data shipping tokens](https://app.logz.io/#/dashboard/settings/manage-tokens/data-shipping?product=logs) page.
2. Copy the **listener URL** and the relevant **account token** you want to use.

Next, log into your [Control Plane Console UI](https://console.cpln.io/), and follow these steps:

1. Navigate to `Secrets` and create a new secret.
2. Name your secret and select `Opaque` from the Secret Type list.
3. Paste the [Logz.io](https://www.logz.io) token string into the content text box and click Create.

This secret will be used when configuring logging using the [UI Console](#enable-logging-using-the-ui-console) or [CLI](#enable-logging-using-the-cli).

## Step 2 - Configuring Shipping Data to Logz.io

You need to enable logging from your [UI Console](#enable-logging-using-the-ui-console) or [CLI](#enable-logging-using-the-cli).

### Enable Logging using the UI Console

1. Open the [Control Plane Console UI](https://console.cpln.io/), click on `Org` in the left menu.
2. Click `External Logs` in the middle context menu.
3. Select `Logz.io` and fill out the required fields.
4. Select the Opaque secret created to authenticate to [Logz.io](https://www.logz.io). Refer to the [generate token credentials](#step-1-generate-token-credentials) section to obtain and configure the necessary credentials.
5. Click Save.

You will be able to see log entries at [Logz.io](https://www.logz.io) shortly after the configuration has been completed.

<Tip>
  The `Listener Host` value is shown on the [Manage tokens](https://app.logz.io/#/dashboard/settings/manage-tokens/data-shipping?product=logs) page.
</Tip>

### Enable Logging using the CLI

The external logging configuration can be created / updated using the CLI's `cpln org patch ORG_NAME -f FILE.yaml` command.

Below is an example of an [Org](/reference/org) manifest (in YAML). Edit and save the YAML as a file and use it as an input to the CLI's `cpln org patch ORG_NAME -f FILE.yaml` command.

Refer to the [generate token credentials](#step-1-generate-token-credentials) section to obtain and configure the necessary credentials.

* Substitute: `ORG_NAME`, `OPAQUE_SECRET`, and possibly the listener host.

<Note>
  Use the listener host URL that matches your [Logz.io](https://www.logz.io) account. The host will be a similar domain name that resolves when using the [Logz.io](https://www.logz.io) dashboard.
</Note>

```yaml YAML theme={null}
kind: org
name: ORG_NAME
spec:
  logging:
    logzio:
      credentials: //secret/OPAQUE_SECRET
      listenerHost: listener.logz.io
```
