Zuplo logo

New Relic Logging Plugin

Changelog entry for New Relic Logging Plugin

New Relic Logging Plugin

We've expanded our range of third-party logging plugins yet again—this time with the addition of New Relic.

Full details can be found in the documentation, but usage follows the same pattern as all the other loggers.

Add the plugin to the Zuplo runtime and configure your options.

import {
  RuntimeExtensions,
  NewRelicLoggingPlugin,
  environment,
} from "@zuplo/runtime";

export function runtimeInit(runtime: RuntimeExtensions) {
  runtime.addPlugin(
    new NewRelicLoggingPlugin({
      // Optional, defaults to "https://log-api.newrelic.com/log/v1"
      url: "https://log-api.newrelic.com/log/v1",
      apiKey: environment.NEW_RELIC_API_KEY,
      service: "MyAPI", // Optional, defaults to "Zuplo"
      fields: {
        field1: "value1",
        field2: "value2",
      },
    }),
  );
}

As with all our loggers, the New Relic Plugin supports custom fields in addition to the standard fields.