How to get Unicorn to display message parameters in the development log?

I just started giving Unicorn a try (by Thin), and so far I like the output format, except that it does not show message parameters for various requests. I really like this functionality to help debug forms, etc.

Unicorn:

20:26:14 web.1 | 127.0.0.1 - - [17/Jan/2012 20:26:14] "POST /basic_simulations HTTP/1.1" 422 24259 0.4838 

What I want ... (this is from webrick):

 Started POST "/basic_simulations" for 127.0.0.1 at 2012-01-17 20:27:22 -0700 Processing by BasicSimulationsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"xxxxx", "basic_simulation"=>{"x1706"=>"1"}, "commit"=>"Submit my answers"} 

Is there any configuration option or something like that where I can enable this feature? Thanks!

+4
source share
4 answers

If you use Foreman with procfile, you can add this line to your Procfile:

  devlog: tail -f log/development.log 

and he will put the development log in a terminal window, for example webrick.

-2
source

UPDATE:

Add this to your config / application.rb file:

 config.logger = Logger.new(STDOUT) 

More here

+6
source

Add this to your config / environment / development.rb file:

 config.logger = Logger.new(STDOUT) 

More here

+2
source

Try this in your site configuration:

 log_format postdata $request_body; access_log /var/log/nginx/postdata.log postdata; 

More info here: Writing POST data from $ request_body

0
source

Source: https://habr.com/ru/post/1391573/


All Articles