Last Updated: February 25, 2016
·
351
· maroe

Rails: Threading & Logging

I ran across a very strange behaviour the other day: the log files for all servers in production mode (with config.threadsafe!) stopped receiving content after a while.

After playing and googling around there is a solution: Use another logger.
The default Rails logger is not threadsafe.

I replaced it by log4r and everything is fine. And additionally I got timestamps and severity messages in the production.log - sweet!