I’ve separated logging for a daemon by logging to a custom Logger object. The problem is SQL still gets logged to the main Rails logfile (development.log etc) and I’d want the SQL to end up in my custom Logger’s logfile instead.
So I want to isolate Active Record logging to a separate file, but only for some processes (where I could set it up after the environment has loaded).
In the end, I solved this by adding a separate Rails instance for the daemon, pointing at the same database. They each have their own log directory now.