Thanks everyone for the replies.

Thanks Ed, I'm glad to hear that there are more people doing it.


On Wednesday, 2 November 2016 09:37:50 UTC+10, ed wrote:
>
> an alternative to this change would be to symlink log/yourlog.log to 
> /dev/null
>
> $ ln -s log/production.log /dev/null
>
> I do this, and it works well for me in dev mode without impact to others 
> sharing the repo or other environments.
>
>
>
>
> On Mon, Oct 24, 2016 at 5:44 PM, Lucas Caton <[email protected] 
> <javascript:>> wrote:
>
>> 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.loge 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.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/rubyonrails-core.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to