-
-
Notifications
You must be signed in to change notification settings - Fork 199
Closed
Description
Description of the issue 📄
We currently exceed the free log quota on Solarwinds/Papertrail.
Steps to fix 🛠
Install the semantic logging gem to condense log lines:
Add this to the Gemfile
:
gem "amazing_print"
gem "rails_semantic_logger"
Run: bundle install
For staging:
# config/environments/staging.rb
if ENV["RAILS_LOG_TO_STDOUT"].present?
$stdout.sync = true
config.rails_semantic_logger.add_file_appender = false
config.semantic_logger.add_appender(io: $stdout, formatter: config.rails_semantic_logger.format)
end
For production:
# config/environments/production.rb
if ENV["RAILS_LOG_TO_STDOUT"].present?
$stdout.sync = true
config.rails_semantic_logger.add_file_appender = false
config.semantic_logger.add_appender(io: $stdout, formatter: config.rails_semantic_logger.format)
end
For Puma (in both environments):
# config/puma.rb
on_worker_boot do
# Re-open appenders after forking the process
SemanticLogger.reopen
end
Profit!
To do 📋
- Claim this issue (comment below, or assign yourself if you are part of the codebar org)
- Fork and clone the repository
- Update the relevant files. Follow the steps to fix section in this issue.
- Commit your changes as one commit. Use the title of this issue as your commit message
- Submit a pull request
- Mention this issue in the PR description by including it's number
- Have your pull request reviewed & merged by a codebar team member
Metadata
Metadata
Assignees
Labels
No labels