reduce system log output inside function
rabbah opened this issue · 6 comments
@remore is it possible to suppress this output?
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:8080
Use Ctrl-C to stop
@rabbah it looks like there is no good way to prevent it.
https://github.com/puma/puma/blob/bcbe81133351e1a4bcee8cbf45816b631cc2717b/lib/puma/runner.rb#L97-L100
https://github.com/puma/puma/blob/bcbe81133351e1a4bcee8cbf45816b631cc2717b/lib/puma/events.rb#L66-L68
Would there be any critical concern related to this?
It bleeds through the webserver elements underlying the function. It would be nice to eschew as such. What about using redirectio to send the log output to dev null at startup at least? I see there’s an option to redirect but didn’t check if the phase ordering works.
Although technically it’s not a difficult issue, but give me some more time to think about it. Now I see the situation and am still trying to figure out the best option among a few possibilities to workaround this. (Yes redirectio could be a workaround but need to check the behavior. I’m suspecting it might be hard to call #redirect_io method of underlying puma webserver from inside Rack application code. Anyways I will check this first later.)
Thanks for giving it some thought.
@csantanapr whatever @remore says :) I'm not the Ruby person....