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

No logs shown in CloudWatch when lograge is enabled (Rails/ECS/Fargate) #325

Open
philipjkim opened this issue Mar 18, 2021 · 1 comment

Comments

@philipjkim
Copy link

I see no logs in CloudWatch after enabling lograge on my Rails app. When I disable lograge, logs are shown in CloudWatch. I don't know the root cause. (AWS ECS with Fargate)

No problem when I run the Rails app on localhost. (all logs shown in STDOUT & log file not created)

  • OK when running bin/rails s
  • OK when running via docker run

Here's the codes related to logging:

config/environments/development.rb:

  config.log_formatter = ::Logger::Formatter.new
  logger = ActiveSupport::Logger.new(STDOUT)
  logger.formatter = config.log_formatter
  config.logger = logger

  config.after_initialize do
    HttpLog.configure do |config|
      config.logger = Rails.logger
    end
  end

config/initializers/lograge.rb:

Rails.application.configure do
  # I can see CloudWatch logs if I comment out the following 2 lines.
  config.lograge.enabled = true
  config.lograge.ignore_actions = ['MiscController#ping']
end

More info:

  • Rails: 6.1.3
  • Puma 5.2.1
  • lograge: 0.11.2
@stevenpitts
Copy link

I've also experienced this, but in my case all the logs showed up in a group after ~1 hour of the app running, possibly after some number of log lines were queued up. Might be the case here too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants