Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read logfile option in config file #249

Closed
h3poteto opened this issue Sep 17, 2016 · 0 comments · Fixed by #252
Closed

Can't read logfile option in config file #249

h3poteto opened this issue Sep 17, 2016 · 0 comments · Fixed by #252

Comments

@h3poteto
Copy link
Contributor

I can't work fine, for example:

rails@085a8fd8cf4a:~/app$ bundle exec shoryuken -R -C config/shoryuken.yml -d
You really should set a logfile if you're going to daemonize
/home/rails/app/vendor/bundle/ruby/2.3.0/gems/shoryuken-2.0.11/lib/shoryuken/cli.rb:80:in `daemonize'
/home/rails/app/vendor/bundle/ruby/2.3.0/gems/shoryuken-2.0.11/lib/shoryuken/cli.rb:34:in `run'
/home/rails/app/vendor/bundle/ruby/2.3.0/gems/shoryuken-2.0.11/bin/shoryuken:6:in `<top (required)>'
/home/rails/app/vendor/bundle/ruby/2.3.0/bin/shoryuken:23:in `load'
/home/rails/app/vendor/bundle/ruby/2.3.0/bin/shoryuken:23:in `<main>'

In shoryuken.yml, I wrote logfile option:

verbose: false
concurrency: 20
delay: 25
pidfile: ./tmp/pids/shoryuken.pid
logfile: ./log/shoryuken.log

but shoryuken didn't read logfile option.

I expect this case occur after #219.
EnvironmentLoader.load read config file, and initialize logger. And daemonize check Shoryuken.options[:logfile]. So, if call daemonize before EnvironmentLoader.load, daemonize fail.

Current shoryuken source code,
https://github.com/phstc/shoryuken/blob/v2.0.11/lib/shoryuken/cli.rb#L32-L39
call daemonize before EnvironmentLoader.load, so didn't read logifle option in config file.

At the same time, I understand #219 is required.

In sidekiq, read config file options and initialize logger, before daemonize.
https://github.com/mperham/sidekiq/blob/v4.1.2/lib/sidekiq/cli.rb#L39-L43

I thought that call initialize logger before daemonize in the same manner as sidekiq, but shoryuken have to load Rails before read config file: #197
therefore I can't fix.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant