簡體   English   中英

找不到 resque worker 的日志作為 systemd 服務

[英]can not find logs of resque worker as a systemd service

我自己在沒有任何 Ruby 背景的情況下托管/支持 Ruby on Rails 應用程序。 如果我沒記錯的話,該應用程序本身主要在德國使用。 但是我的問題與應用程序無關,而是與使用的 resque worker 無關。

我將 resque worker 配置為 systemd 服務,如下所示:

[Unit]
Description=resque-worker for pageflow

[Service]
User=pageflow
WorkingDirectory=/home/pageflow/pageflow_daad
ExecStart=/usr/local/bin/bundle exec /usr/local/bin/rake resque:work > 
/home/pageflow/pageflow_daad/log/resquework.log &
#ExecStart=/home/pageflow/.rbenv/shims/rake resque:work &
Environment=QUEUE=*
Environment=RAILS_ENV=production

[Install]
WantedBy=multi-user.target

該工作人員可以毫無問題地處理圖像/視頻上傳。 現在我添加了一個新的應用程序功能,它可以抓取特定的頁面。 這個過程也由工人處理。 在這種情況下,我最終會遇到在任何日志中都找不到的錯誤。 具體來說,我根本找不到工人或調度員的任何日志。

我現在查看了這些位置:

  • Applicationroot/log/production.log
  • Applicationroot/log/jobs/production(應用開發者告知不再使用)
  • /var/log/nginx/error.log
  • journalctl -u resque-worker.service

這是systemctl status resque-worker.service的 output

esque-worker.service - resque-worker for pageflow
   Loaded: loaded (/etc/systemd/system/resque-worker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-03-11 13:46:52 CET; 3 days ago
 Main PID: 30864 (bundle)
    Tasks: 5
   Memory: 186.0M
      CPU: 2min 10.308s
   CGroup: /system.slice/resque-worker.service
           └─30864 resque-1.27.4: Waiting for default,mailer,mailers,resizing,scraping,slow

Mar 11 13:46:52 ostheim-stg bundle[30864]: Gem::Specification#rubyforge_project= called from /home/pageflow/pageflow_daad/vendor/bundle/ruby/2.3.0/specifications/zencoder-2.5.1.gemspec:15.
Mar 11 13:46:52 ostheim-stg bundle[30864]: NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Mar 11 13:46:52 ostheim-stg bundle[30864]: Gem::Specification#rubyforge_project= called from /home/pageflow/pageflow_daad/vendor/bundle/ruby/2.3.0/specifications/vegas-0.1.11.gemspec:17.
Mar 11 13:46:52 ostheim-stg bundle[30864]: NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Mar 11 13:46:52 ostheim-stg bundle[30864]: Gem::Specification#rubyforge_project= called from /home/pageflow/pageflow_daad/vendor/bundle/ruby/2.3.0/specifications/rufus-scheduler-2.0.24.gemspec:16.
Mar 11 13:46:56 ostheim-stg bundle[30864]: DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Mar 11 13:46:56 ostheim-stg bundle[30864]: Please register a mime type using `register_mime_type` then
Mar 11 13:46:56 ostheim-stg bundle[30864]: use `register_compressor` or `register_transformer`.
Mar 11 13:46:56 ostheim-stg bundle[30864]: https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
Mar 11 13:46:56 ostheim-stg bundle[30864]:  (called from block in <class:Railtie> at /home/pageflow/pageflow_daad/vendor/bundle/ruby/2.3.0/gems/react-rails-1.8.0/lib/react/rails/railtie.rb:110)

誰能給我提示在哪里進一步尋找? A 還將應用程序日志級別更改為:info 以確保不會錯過任何日志。

我正在使用 Rails 5.2.0 和 Ruby 2.3.1p112

提前致謝

經過數小時的研究,出於某種原因,我現在在Approot/logs/production.log中找到了日志,因此是默認的 Rails 日志位置。 我真的不知道為什么我事先錯過了。 也許是因為我更改了日志級別配置的行......

因此供將來參考:即使 resque worker 由 systemd 處理,日志仍然可以在環境中配置的應用程序日志記錄中找到。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM