Hi there.
I know this, although easy, would be a big step. So I’d love to hear your thoughts.
I can’t remember the last time I needed to open/read log/development.log
or log/test.log
.
This is just consuming disk space unnecessarily (my test.log
e easily reaches more than 1 GB!).
After talking to some other developers, all of them agreed they don’t use it as well.
What if we change this behaviour to be optional? It’d still display the logs through the STDOUT
, though.
I’ve been doing it in my projects and couldn’t find a reason not to do it.
The way I currently do it is similar to what Heroku’s rails_12factor gem used to do (and now is the default in Rails for production environment):
config/environments/development.rb
Prevents from writing logs on log/development.log
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config/environments/test.rb
Prevents from writing logs on log/test.log
config.log_level = :warn
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
Thank you,
Lucas.