How to get NewRelic to read my logs from Rails 8 app
suzumejakku
HOBBYOP

6 months ago

Hi,

I have a Rails 8 app which is deployed in a Docker container (I use the standard Docker file provided by Rails when creating a new app).

I would like to use NewRelic for some of the services they provide to monitor my application. I have installed the 'newrelic_rpm' gem, and NewRelic became able to monitor the usage of my app. So far so good.

Now I'd like NewRelic to ingest my logs as well. So far, impossible to make it work. Here is what I did :

  • Gemfile : gem "newrelic_rpm"

  • newrelic.yml :

    application_logging.enabled: true
    application_logging.forwarding.enabled: true
    application_logging.forwarding.log_level: info
    application_logging.forwarding.max_samples_stored: 10000
    application_logging.local_decorating.enabled: false
    application_logging.metrics.enabled: true
    

    (of course, the license_key is set as well)

  • production.rb:

    config.logger   = ActiveSupport::TaggedLogging.logger(STDOUT)
    config.log_formatter = ::NewRelic::Agent::Logging::DecoratingFormatter.new
    

    Is there anything else I need to do ? When I "configure logs" in NewRelic, it sees the connection to "Ruby", but not to "Infrastructure" and "Logs".

$10 Bounty

4 Replies

suzumejakku
HOBBYOP

6 months ago

Hi,

I am getting answers via email, but they are not reflected in this chat... any idea why ? I'd like to respond to those answers..


suzumejakku

Hi,I am getting answers via email, but they are not reflected in this chat... any idea why ? I'd like to respond to those answers..

6 months ago

They where AI spam from userbots, and have since been removed, my apologies.


brody

They where AI spam from userbots, and have since been removed, my apologies.

suzumejakku
HOBBYOP

6 months ago

Thank you


case
PRO

6 months ago


Loading...