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
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?
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)
bin/rails s
docker run
Here's the codes related to logging:
config/environments/development.rb
:config/initializers/lograge.rb
:More info: