Hi, I use the ready_pipe branch. I set "logger" to log into Syslog, but the
issue I'll explain here is the same even if I log to a file.
I runned Unicorn daemonized. Now imagine I do a typo in my Rack config.ru (I
use preload=true). When sending USR2 to the master it fails (ok) but the
raised exception is not shown in the logger, instead it's lost as $stderr is
/dev/null.
Even worse, imagine Unicorn is not running and I start it daemonized (with a
init script). Due to the typo in config.ru I see:
"master failed to start, check stderr log for details"
But the message is useless since stderr is /dev/null so I se nothing in
Syslog.
So I suggest the following:
If the process fails after setting the logger, then rescue any exception, log
it to the logger and raise it as normal:
rescue => err
logger.fatal "#{err.class}: #{err.message}\n#{err.backtrace.join("\n")}"
raise err
end
I'm trying to figure where exactly to include such code but it seems a bit
complex. Any tip please?
Thanks a lot.
--
Iñaki Baz Castillo <[email protected]>
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying