2 ms·
Here is the solution I use in our production Rails apps (3.2.6). Add the following code snippet into your config/application.rb. config.after_initialize do
by cygwin98 14y ago
Here is the solution I use in our production Rails apps (3.2.6). Add the following code snippet into your config/application.rb.
config.after_initialize do
# Reverse the deprecation of flush in BufferedLogger
module ActiveSupport
class BufferedLogger
def flush
@log_dest.flush
end
def respond_to?(method, include_private = false)
super
end
end
end
# Let the OS buffer the log
Rails.logger.instance_variable_get(:@logger).instance_variable_get(:@log_dest).sync = false
end