Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

BufferedLogger threading issues

#6671

There are a couple of threading issues with ActiveSupport::BufferedLogger.

  1. If a thread is spawned and logs messages but does not flush the log, the messages will never be written and will remain in the buffer forever.

threads = []
urls.each do |url
threads << Thread.new do

logger.info("fetching #{url}")
fetch(url)
logger.info("#{url} retrieved")

end end
threads.each{|t| t.join}

  1. Silencing a logger for a block in one thread will silence it will silence it for all other threads as well. This means in a multi-threaded Rails application, log messages can be lost.

Reported by Brian Durand · April 5th, 2011 @ 03:06 AM

State: new
Milestone: none
Assigned to: nobody
Importance: none