• EnglishEspañol日本語한국어Português
  • Log inStart now

Forward Kong Gateway logs

Forwarding Kong Gateway logs to New Relic provides valuable insights into API gateway performance, health, security, and usage. This document outlines how to direct the File Log plugin from Kong Gateway to forward logs from Kong Gateway to New Relic.

Compatibility and requirements

To use this log forwarding plugin, you need the following:

Install the Kong Gateway plugin

To receive logs from Kong Gateway, you need to connect the Kong Gateway File Log plugin to the New Relic Kubernetes integration. This set-up directs the logs through a standard output (/dev/stdout), which establishes a connection between the New Relic Kubernetes integration and Kong Gateway.

Install the New Relic Kubernetes logs integration

If you haven't already, install the New Relic Kubernetes plugin for log forwarding, then return to this doc. The plugin uses a standalone Docker image that collects and forwards logs from your Kubernetes environment.

Configure the File Log plugin

Once you've installed the Kong Gateway File Log pluin, you need to direct the plugin to send logs to /dev/stdout. Here is an example manifest for this configuration:

# file-log-plugin.yaml
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: global-file-log
annotations:
kubernetes.io/ingress.class: kong
labels:
global: "true"
config:
path: "/dev/stdout" # Directs logs through a standard output so New Relic can receive Kong Gateway logs
plugin: file-log

Deploy the configuration to your Kubernetes cluster

Deploy the File Log plugin configuration to your Kubenrnetes cluster, but be sure to update file-log-plugin.yaml with the actual filename of your manifest:

bash
$
kubectl apply -f file-log-plugin.yaml -n kong

Confirm that your logs are in the New Relic platform

Once you've deployed the configurations, go to one.newrelic.com > All Capabilities > Logs. Confirm that logs from Kong Gateway are appearing in the platform by triggering some data, then running a query that filters for that data.

You can start building that query with this example:

SELECT * FROM Log

What's next?

Now that you're forwarding your Kong Gateway logs to New Relic, we recommend checking out some of our other docs and tutorials:

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.