• /
  • EnglishEspañol日本語한국어Português
  • ログイン今すぐ開始

Upgrade to automatic logs in context

This guide is applicable to customers who have previously configured log forwarding or logs in context; if you have not configured either feature, we recommend upgrading to the latest version of the agent to take advantage of automatic log forwarding and local decoration.

If you are currently sending application logs to New Relic, it is possible to send duplicate logs if you upgrade to the latest APM language agent without revising your current logging strategy. The optimal migration path will be dependent on your application and its environment.

If you have extensive data processing or enrichment logic in your existing log forwarder configuration, sending logs directly from the APM agents will skip that step.

ヒント

Got lots of Go logs? Check out our tutorial on how to optimize and manage them.

There are two primary upgrade paths we recommend to avoid sending duplicate logs:

  1. Update to the latest APM agent, which automatically forwards logs, and then disable the log forwarder:
    • Update your application’s logging framework configuration to ensure your application is not writing logs for staging or production. This can be to a file on disk, or to STDOUT if you’re collecting logs using a sidecar
    • Disable the log forwarder tailing your application’s log file. Disable container(s) used to collect application logs
    • Disable log forwarding with your cloud provider
    • Restart APM agent/deploy your changes
  1. Use APM agent with log forwarder (recommended only if a forwarder is already in place):
    • Update the APM agent
    • Configure the APM agent to ensure local log decoration is enabled and log forwarding is disabled.
    • Revert previous changes that were made to the application’s logging framework configuration to enable manual logs in context.
    • Confirm application’s logging framework is configured to write app logs to STDOUT or to a file that is being monitored/watched by a log forwarder.
    • Restart APM agent/deploy your changes

Enabling Local Decoration

Documentation on configuring local decoration on the latest version of the language agents can be found below:

Upgrading with Kubernetes

If logs in context has been configured, customers using our Kubernetes log forwarding integration will need to revert the changes made to the application’s logging framework configuration when implementing logs in context manually. This is necessary to preserve the Kubernetes metadata enrichment performed by our integration.

Note that the application’s logging framework must be configured to write application logs to STDOUT.

Local decoration needs to be enabled on the agent to ensure your logs are contextualized. No changes need to be made to your log forwarding configuration.

Follow the steps below to upgrade your Kubernetes monitoring:

  1. Update the APM agent.
  2. Configure the APM agent to ensure local log decoration is enabled and log forwarding is disabled.
  3. Revert previous changes that were made to the application’s logging framework configuration to enable manually logs in context.
  4. Confirm application’s logging framework is configured to write app logs to STDOUT or to a file that is being monitored/watched by a log forwarder.
  5. Restart APM agent/deploy your changes.
Copyright © 2024 New Relic株式会社。

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