Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility of disabling logging or use custom logger #82

Closed
hungryblank opened this issue Nov 13, 2013 · 9 comments
Closed

Possibility of disabling logging or use custom logger #82

hungryblank opened this issue Nov 13, 2013 · 9 comments

Comments

@hungryblank
Copy link

In our environment we don't want node applications to write to stdout or write to a file, we'd like to completely disable logging or specify our own function used for logging.

@othiym23
Copy link
Contributor

If you configure the module to log to stdout or stderr and set the log level to fatal, you will in effect disable the module's logging, because no logging calls are at the fatal level of severity.

Being able to pass in a custom logger is an interesting idea, because the logger just exports a Bunyan instance as its API, but there are practical considerations that make it tricky to cut over. What's the problem you're trying to solve?

@hungryblank
Copy link
Author

All our node applications already have a logger instance (which could implement a Bunyan compatible interface) using syslog (or a configurable log destination) and there's no reason why newrelic agent should log on a different destination then the rest of the application.

using stdout/stderr is a hack and in general we do not want to collect or care about stdout/stderr of daemon processes (like is the case of webserver).

The fact that currently you aren't using the fatal severity is purely accidental and not guaranteed to work in the future.

@othiym23
Copy link
Contributor

Conceptually, New Relic for Node is not part of your application – it's an independent component that happens to run in the same process as your application. I draw this distinction because the main consumer of the module's logs is New Relic support (which often includes me, as one of the developers of the module), and having New Relic's logging intermingled in with the rest of your application's logging both reduces the signal/noise ratio for support and makes it harder for us to request the complete New Relic log output, which is essential for troubleshooting most common forms of New Relic weirdness.

I agree that logging to std{out,err} feels gross, but it's necessary to support PaaS vendors like Heroku that don't provide access to the local filesystem. I can guarantee that we'll never use the fatal log level, as all of the things that would use that level are hard startup failures that yell on stderr and then disable New Relic.

I'm not saying we won't make this change, but practically speaking we have a lot of stuff on our backlog and I can't promise we'll get to it anytime soon.

@othiym23
Copy link
Contributor

Whoah there, GitHub! Didn't mean to close this.

@othiym23 othiym23 reopened this Nov 13, 2013
@danielsantiago
Copy link

If I disable logging completely (log level to fatal), I will still get New Relic working?
My problem is that the module is polluting my logs and I'm using logentries that read all the stdout and stderr from heroku.

Thanks

@othiym23
Copy link
Contributor

If I disable logging completely (log level to fatal), I will still get New Relic working?

Yes. New Relic will never log at the fatal log level, and the module will still work.

@txase
Copy link

txase commented Jun 26, 2014

Hi @hungryblank,

We have recorded your request for better logging support internally. We are also cleaning our issues in GitHub, and there is no further action we can take at this time. As such, I am closing it out.

Thank you for your understanding as we tidy up our issue tracker!

@adamhathcock
Copy link

Is this still on the table to do?

@michaelgoin
Copy link
Member

@adamhathcock logging can be turned off via the file-based config or via ENV variable.

logging: {
  enabled: false
}

OR

NEW_RELIC_LOG_ENABLED = false

Using a custom logger is not currently supported but can always be added as a feature request.

cmcadams-newrelic pushed a commit to cmcadams-newrelic/node-newrelic that referenced this issue Jan 29, 2024
…653beadbaf624f4c8

[Snyk] Security upgrade newrelic from 8.17.1 to 10.3.1
jsumners-nr pushed a commit to jsumners-nr/node-newrelic that referenced this issue Apr 11, 2024
jsumners-nr pushed a commit to jsumners-nr/node-newrelic that referenced this issue Apr 16, 2024
Explicitly list @koa/router in supported modules.
bizob2828 pushed a commit to bizob2828/node-newrelic that referenced this issue Apr 19, 2024
bizob2828 pushed a commit to bizob2828/node-newrelic that referenced this issue Apr 23, 2024
bizob2828 added a commit to bizob2828/node-newrelic that referenced this issue Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants