question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add log message for no config file found

See original GitHub issue

Is your feature request related to a problem? Please describe.

Currently !config results in a message ‘Module not enabled in configuration; not starting.’

if (!config || !config.agent_enabled) {
      logger.info('Module not enabled in configuration; not starting.')

https://github.com/newrelic/node-newrelic/blob/main/index.js#L79

This can be misleading and makes troubleshooting more difficult when it could be two very different issues.

Feature Description

Add a log message similar to what the Ruby agent has:

 NewRelic::Agent.logger.warn(
            "No configuration file found. Working directory = #{Dir.pwd}",
            "Looked in these locations (based on #{based_on}): #{candidate_paths.join(", ")}"

It may be worthwhile to include next steps as the missing ‘app_name’ log message does:

For example:

New Relic requires a newrelic.js file in the root directory of your app or set environment variable NEW_RELIC_NO_CONFIG_FILE=true

But it may be difficult to include all possible cases, for example if using ‘NEW_RELIC_HOME’ rather than having ‘newrelic.js’ in the root directory.

Describe Alternatives

Current troubleshooting strategy when logs show ‘Module not enabled in configuration; not starting.’ :

https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#home

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
berndartmuellercommented, Mar 29, 2021

@carlo-808 I already had logging disabled via the config file.

Turned out I had to remove process.env.NEW_RELIC_NO_CONFIG_FILE = 'true'; from my Jest setup file. Now no logs are shown anymore while running automated tests.

1reaction
berndartmuellercommented, Mar 27, 2021

Is there a way to disable this log message (e.g. while running automated tests)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Warning config file server conf not found - Edureka
I have log messages that sent to a file or to sys.stderr: import logging logging.debug('Debugging information') logging.info('Informational ...
Read more >
java - No log4j2 configuration file found. Using default ...
Problem 1. ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Read more >
Upon logging into BMC, a message “Config file not found” is ...
Upon logging into BMC, below message is seen: Config file not found. BMC>”. Sign in to view the entire content of this KB...
Read more >
ERROR StatusLogger No log4j2 configuration file found ...
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console ; groupId · org.apache.
Read more >
Config Files and Logging - Medium
Why writing the messages in a log file important? Any message outputted in console using print() statements are not available for debugging ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found