[Mongrel] exception logging

Dane Jensen careo at fastmail.fm
Sun Dec 24 01:39:58 EST 2006

On Dec 22, 2006, at 8:53 PM, Zed A. Shaw wrote:

> On Fri, 22 Dec 2006 17:50:45 -0800
> Dane Jensen <careo at fastmail.fm> wrote:
>> Hi all-
>> I'm running mongrel with a tiny HttpHandler that hooks into a larger
>> library I'm working on. I've run into a snag with trying to debug
>> with it in that I'm not entirely sure how to get the exception logs
>> of errors that are raised.
>> All I get to stderr is this:
>> 	Fri Dec 22 17:16:14 -0800 2006: ERROR: Couldn't find Models::Contact
>> without an ID
>> While I like knowing an error occurred, I'd really really really love
>> to know where and be able to find why.
>> I'm probably missing something simple in the docs, but how do I turn
>> this on or set it up?
> Yep Dane, for the folks who want the exceptions in production (or  
> even just development) you just hit your process with:
> killall -USR1 mongrel_rails
> Or send USR1 to a specific mongrel process to get it's light debug  
> output.  This is fast enough to run in production mode in case you  
> have a problem you need to debug that only shows up there.
> When you get the stack trace send it to me.  You really should be  
> seeing errors like that at the Mongrel level but rather you should  
> see them at the Rails level.


Thanks for pointing me towards the USR1 signal. I'm not running  
mongrel_rails, as I'm not using Rails, and USR1 killed the process  
outright. I thought that was strange (especially because I recall  
seeing mongrel spit out something about setting up signal handlers at  
one point on another project....) and dug into the source.

Turns out I needed a simple 'config.setup_signals' before my  
'config.join' in my handler. Oops.


More information about the Mongrel-users mailing list