mattmatt/lograge — pull request #5 by jbbarth (2012-04-17 00:02:57+00:00)
Title: Avoid potential TypeError when extracting payload

I'd like to use lograge with passenger standalone, but when I enable it, I get this :

```
Could not log "process_action.action_controller" event. TypeError: can't convert nil into String
/usr/local/rvm/gems/ruby-1.9.3-p0@cartocs/gems/lograge-0.0.4/lib/lograge/log_subscriber.rb:9:in `process_action'
...
```

Adding a debug line at the beginning of Lograge::RequestLogSubscriber#extract_status, I got this payload :

```
{:controller=>"WelcomeController", :action=>"index", :params=>{"controller"=>"welcome", "action"=>"index"}, :format=>:html, :method=>"GET", :path=>"/"}
```

Passenger hits the root of the application on startup (maybe to catch dependency problems?), but it seems there's no ":status" nor ":exception" key, hence lograge extracting "nil". Maybe it's a rails bug or something I didn't understand well enough, but I think lograge should be safer in this regard.

Let me know what you think, and anyway, thanks for lograge, it made my production logs much more beautiful !