Send logs to New Relic

Coolify's built-in New Relic log drain sends opted-in resource logs to the New Relic Log API.

The short version

Copy an ingest license key, choose the Log API endpoint for your New Relic region, save both values on the server's Log Drains page, then enable Drain Logs and restart each resource you want to forward.


Before you start

Ingest license keyUse a New Relic ingest license key, not a user key or another API key type.
Regional endpointChoose the complete HTTPS Log API URL for the region where the account stores data.
Validated serverUse the server that runs the resources and confirm it can reach the selected endpoint on port 443.

Create or copy a New Relic ingest license key. Coolify accepts letters, numbers, underscores, hyphens, and periods in License Key.


Choose the endpoint

New Relic Log API endpoints

Use the endpoint for the region where your New Relic account stores data.

United States

https://log-api.newrelic.com/log/v1
  • Use for accounts in the United States data region
  • Keep the complete HTTPS URL, including /log/v1

European Union

https://log-api.eu.newrelic.com/log/v1
  • Use for accounts in the European Union data region
  • Keep the complete HTTPS URL, including /log/v1

Coolify requires Endpoint to be a valid URL.


Configure New Relic in Coolify

Connect the server to New Relic

Keep the drain disabled while editing its fields, then enable it after the values are saved.

1

Open the server Log Drains page

2

Enter the license key

3

Enter the regional endpoint

4

Save the New Relic settings

5

Enable the drain

  • Open Servers, select the server that runs the resources, then open Configuration > Log Drains.
  • In New Relic, leave Enabled off and paste the ingest license key into License Key.
  • Enter the regional Log API URL in Endpoint.
  • Select Save in the New Relic section.
  • Turn on Enabled. Coolify starts the server's coolify-log-drain container.

Only one server-level log drain can be enabled at a time. Disable another active destination before enabling New Relic.

Enabling the drain is not an ingestion test

Coolify checks the required field formats and starts Fluent Bit. It does not verify the license key or send a test event to the New Relic endpoint.


Enable a resource

Follow Enable log draining for a resource, then restart or redeploy the resource.

The built-in New Relic configuration flushes records every five seconds.


Identify logs

The built-in configuration adds fields that help you filter records.

Built-in log identification

The server label is automatic. The resource label is added only when the resource provides COOLIFY_APP_NAME.

Server label

coolify.server_name
  • Added automatically to every record
  • Identifies the Coolify server that forwarded the record

Resource label

coolify.app_name
  • Created from the resource environment variable COOLIFY_APP_NAME
  • Available after you save the variable and restart the resource

For example, add this environment variable to the resource:

COOLIFY_APP_NAME=worker

The built-in filter excludes log records whose message contains 127.0.0.1. Local health-check requests may therefore be absent from New Relic.


Verify delivery

  1. Cause the resource to write a recognizable message to stdout or stderr.
  2. Wait at least five seconds.
  3. Open New Relic Logs and search recent events for the message, coolify.server_name, or coolify.app_name.

Verification in New Relic is required because Coolify does not perform a provider connection test.


Update the endpoint or license key

  1. Turn off Enabled in the New Relic section.
  2. Update License Key or Endpoint.
  3. Select Save.
  4. Turn on Enabled again.
  5. Generate a new resource log and confirm that it arrives in New Relic.

Fix missing logs

  1. Confirm New Relic is the enabled server drain and the resource's Drain Logs setting is on.
  2. Confirm you restarted or redeployed the resource after enabling the setting.
  3. Confirm the key is an ingest license key for the same New Relic account and region as the endpoint.
  4. Confirm the server can reach the selected endpoint on port 443.
  5. Inspect the Fluent Bit container on the resource server:
docker ps --filter name=coolify-log-drain
docker logs --tail 100 coolify-log-drain

Authentication, endpoint, and network errors appear in the Fluent Bit output.


Continue with log drains

On this page