---
title: Forward your logs to New Relic
source: https://docs.newrelic.com/docs/logs/forward-logs/enable-log-management-new-relic
---

Our log management capabilities help you to collect, process, explore, query, and alert on your log data. To get your logs into New Relic, you can use any of these options:

![Diagram of options to get your logs into New Relic](https://docs.newrelic.com/images/logs_diagram_log-forward-options.webp "Log forwarding options into New Relic")

For an overview of our various logging solutions, see [Introduction to logs](https://docs.newrelic.com/docs/logs/get-started/get-started-log-management#integrate-logs).

> #### 💡 TIP
>
> Got lots of logs? Check out our [tutorial on how to optimize and manage them](https://docs.newrelic.com/docs/tutorial-large-logs/get-started-managing-large-logs/).

Here are some details on how to accomplish specific use cases:

| If you want to do this...                                                                       | Use one of these log forwarding options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Collect logs that are written to a local file on disk                                           | Use our solutions to [forward logs from operating systems](#forward-infra), including our infrastructure agent, Fluent Bit, Fluentd, Logstash, and syslog/TCP. Use our [guided install for infrastructure monitoring](https://docs.newrelic.com/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent) as a lightweight data collector for your apps' and hosts' logs.                                                                                                                                                                                                                                                                                                                 |
| Use your cloud forwarding platform                                                              | Collect service-level logs, application logs, infrastructure logs, or all of the above from your cloud platform, including [Amazon AWS](#forward-amazon), [Google Cloud Platform](https://docs.newrelic.com/docs/logs/forward-logs/google-cloud-platform-log-forwarding), [Microsoft Azure](https://docs.newrelic.com/docs/logs/forward-logs/azure-log-forwarding), and [Heroku](https://docs.newrelic.com/docs/logs/forward-logs/heroku-log-forwarding/).                                                                                                                                                                                                                                           |
| Collect logs from apps running in Docker containers, either standalone or when using Kubernetes | For Kubernetes environments, use our [Kubernetes plugin](https://docs.newrelic.com/docs/logs/forward-logs/kubernetes-plugin-log-forwarding/). For Docker environments, we offer a few options: - Use our [APM logs in context](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/get-started-logs-context) - Use our infrastructure agent to collect host-level logs. In the `logging.yml` config file be sure to tail the `/var/log/containers/*.log` directory. For example: ```yml logs:   - name: Docker-logs     file: /var/log/containers/*.log # Path to Docker log files ``` - Use our [Standalone Docker image](https://hub.docker.com/r/newrelic/newrelic-fluentbit-output) |
| Collect logs directly from your apps, regardless of where they are hosted                       | Use our APM agent and infrastructure agent. Let your app's APM agent forward log data directly to New Relic with [APM logs in context](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/get-started-logs-context). No need to install or maintain additional third-party software!                                                                                                                                                                                                                                                                                                                                                                                                   |
| Do something else                                                                               | If our log forwarding options don't meet your needs, you can: - Use our [Log API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api) to forward your logs via HTTP. - Use syslog protocols to forward your logs via a [TCP endpoint](https://docs.newrelic.com/docs/logs/log-api/use-tcp-endpoint-forward-logs-new-relic). - Use any of our [other available options](#forward-other).                                                                                                                                                                                                                                                                                                |

## Get started with log forwarders [#compatibility-requirements]

You can forward logs via our infrastructure agent or one of our supported third-party log services. Here's how:

1.  Have your New Relic license key ready for the account you want to report logs to.
2.  Install a [compatible log forwarder](#log-forwarding).
3.  Ensure that outbound connectivity on TCP port 443 is allowed to the [CIDR range](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/networks/#infrastructure) that matches your [region](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/our-eu-us-region-data-centers).
4.  Depending on where your account data is stored in New Relic, use the DNS name `log-api.newrelic.com` (US, default), `log-api.eu.newrelic.com` (EU), or `log-api.jp.nr-data.net` (Japan) for configuration.
5.  If applicable, configure your app's APM agent by following the [manual logs in context](https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/configure-logs-context/configure-logs-context-apm-agents/) procedures.

## Log forwarding options [#log-forwarding]

Aside from [our APM agents](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/get-started-logs-context), we provide several other solutions to forward your logs to New Relic.

### Infrastructure agent (recommended) and OS solutions [#forward-infra]

Using our infrastructure agent is one recommended path for log management because it gives you some powerful log reporting and configuration options. For details about setting this up, see [Infrastructure agent logs](https://docs.newrelic.com/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent).

If you don't need the host metrics automatically included with infrastructure log forwarding, or if you already have a log forwarder, you can use any of the following options to forward your logs to New Relic:

-   [Fluent Bit plugin](https://docs.newrelic.com/docs/logs/forward-logs/fluent-bit-plugin-log-forwarding)
-   [Fluentd plugin](https://docs.newrelic.com/docs/logs/forward-logs/fluentd-plugin-log-forwarding)
-   [Logstash plugin](https://docs.newrelic.com/docs/logs/forward-logs/logstash-plugin-log-forwarding/)
-   [Syslog/TCP](https://docs.newrelic.com/docs/logs/log-management/log-api/use-tcp-endpoint-forward-logs-new-relic)

### Amazon [#forward-amazon]

We support the following Amazon log forwarders:

-   [AWS CloudFront plugin](https://docs.newrelic.com/docs/logs/forward-logs/cloudfront-web-logs)
-   [AWS CloudWatch plugin](https://docs.newrelic.com/docs/logs/forward-logs/aws-lambda-sending-cloudwatch-logs/)
-   [AWS FireLens plugin](https://docs.newrelic.com/docs/logs/forward-logs/aws-firelens-plugin-log-forwarding/)
-   [AWS Kinesis Firehose](https://docs.newrelic.com/docs/logs/forward-logs/stream-logs-using-kinesis-data-firehose/)
-   [AWS Lambda for sending logs from S3](https://docs.newrelic.com/docs/logs/forward-logs/aws-lambda-sending-logs-s3/)

### Microsoft [#forward-microsoft]

We support the following Microsoft log forwarder:

-   [Azure ARM template](https://docs.newrelic.com/docs/logs/forward-logs/azure-log-forwarding/)

### Other supported log forwarders [#forward-other]

We support the following log forwarders. Some of these options come with quickstarts, which give you out-of-the-box dashboards and alerts. You can install quickstarts after setting up your log forwarding.

-   Akamai DataStream 2:
    -   [Akamai instructions](https://techdocs.akamai.com/datastream2/docs/stream-new-relic)
    -   [Quickstart](https://newrelic.com/instant-observability/datastream2/cb995039-39d8-44d9-97c3-58174a1337f2)
-   [Cloudflare Logpush](https://docs.newrelic.com/docs/logs/forward-logs/cloudflare-logpush-forwarding)
-   Fastly:
    -   [Fastly instructions](https://docs.fastly.com/en/guides/log-streaming-newrelic-logs)
    -   [Quickstart](https://newrelic.com/instant-observability/fastly-cdn/c5c5dd30-dcdf-46b6-9412-f9a1bba5a600)
-   [Google Cloud Platform Pub/Sub](https://docs.newrelic.com/docs/logs/forward-logs/google-cloud-platform-log-forwarding)
-   [Heroku log streaming](https://docs.newrelic.com/docs/logs/forward-logs/heroku-log-forwarding/)
-   [Kubernetes plugin](https://docs.newrelic.com/docs/logs/forward-logs/kubernetes-plugin-log-forwarding/)
-   [Vector plugin](https://docs.newrelic.com/docs/logs/forward-logs/vector-output-sink-log-forwarding)

## TCP endpoint [#enable-endpoint]

In some situations you may not have log forwarders; for example, with CDNs, hardware devices, or managed services. You can use syslog protocols such as `rsyslog` and `syslog-ng`, and forward your logs to New Relic via a [TCP endpoint](https://docs.newrelic.com/docs/logs/log-management/log-api/use-tcp-endpoint-forward-logs-new-relic/).

## Log API [#enable-api]

If you prefer to connect to New Relic without installing a plugin, we offer an HTTP input integration. This option sends your monitored log data directly to New Relic via the [Log API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api).

## How log forwarding works [#enable]

The following diagram shows the lifecycle of a log message for an app, from enrichment with APM agent metadata (contextual logging), to formatting and forwarding the log data to New Relic.

![Diagram of how your logs flow into New Relic](https://docs.newrelic.com/images/logs_diagram_NR-logs-in-context.webp "Lifecycle of forwarding logs to New Relic")

This diagram illustrates the flow of log messages through New Relic.

Standard log formatters transform log events into meaningful output (such as text files) that can be used by downstream people and processes. The `NewRelicFormatter` transforms log events into the JSON format expected by New Relic. These files contain log information and extended metadata.

When you configure your log forwarder (our infrastructure agent, Fluentd, Logstash, etc.), you can also extend and enrich your log data. By configuring [logs in context](https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/configure-logs-context/configure-logs-context-apm-agents/), the log enricher links the formatted log data with additional transaction information from your application or host.

Now your log files are enriched with enhanced metadata and contextual logging data. Your log forwarder sends the files to our logging endpoint for processing. From there you can use our log management capabilities to view, query, set up alerts, and more in New Relic.

## What's next? [#what-next]

After you enable your log forwarder, make the most of your data in New Relic with our log management capabilities:

-   Explore the logging data across your platform with our [logs UI](https://docs.newrelic.com/docs/logs/ui-data/use-logs-ui).
-   See your logs in context of your app's performance in the [APM UI](https://docs.newrelic.com/docs/logs/ui-data/use-logs-ui/#links). Troubleshoot [errors](https://docs.newrelic.com/docs/apm/apm-ui-pages/error-analytics/errors-page-find-fix-verify-problems/) with [distributed tracing](https://docs.newrelic.com/docs/apm/distributed-tracing/ui-data/understand-use-distributed-tracing-data), stack traces, application logs, and more.
-   Get deeper visibility into both your application and your platform performance data if you're forwarding your logs with our [infrastructure agent](https://docs.newrelic.com/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/). Review your [infrastructure logs](https://docs.newrelic.com/docs/logs/ui-data/use-logs-ui/#links) in the UI.
-   Set up [alerts](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-alert-conditions/).
-   [Query your data](https://docs.newrelic.com/docs/query-your-data/explore-query-data/get-started/introduction-querying-new-relic-data/) and [create dashboards](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/). For example, see our NerdGraph tutorials to query and manage your [data partition rules](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-data-partition-rules-tutorial) and your [log parsing rules](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-log-parsing-rules-tutorial).
