No log file (Ruby)

Problem

There is no New Relic logfile in log/newrelic_agent.log.

Solution

If there is no newrelic_agent.log file, try the following steps to diagnose:

  1. Verify that the agent is actually being required by your application:

    • Ensure that the newrelic_rpm gem line in your Gemfile is not marked with require: false, which prevents Bundler from requiring the gem. You can remove the require: false statement, or you can manually control the newrelic_rpm gem yourself by calling require 'newrelic_rpm' elsewhere in your code during application startup.
    • If the newrelic_rpm gem is in a group within your Gemfile, ensure that group is being loaded in the environment to which you are deploying.
    • Ensure that the newrelic_rpm line in your Gemfile is not wrapped in a conditional that evaluates to false in the environment to which you are deploying.
  2. Make sure that the log directory within your application's root directory exists and is writable by the user that your application is running as.
  3. Ensure the current working directory from which you start your app server processes is the same as the root directory for your app (that is, the current working directory should contain a log directory).

For debugging purposes, it may be helpful to force the agent to be enabled and send its log output to STDOUT. To do this, set the environment variables NEW_RELIC_LOG=stdout and NEW_RELIC_AGENT_ENABLED=1 when starting your application server.

For more help

Additional documentation resources include:

Join the discussion about Ruby in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.