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

Is it possible to write delayed_jobs.log to Logs in Openshift pod? #1165

Open
satriajanaka09 opened this issue Mar 17, 2022 · 0 comments
Open

Comments

@satriajanaka09
Copy link

satriajanaka09 commented Mar 17, 2022

The application that me and my team working on use Ruby on Rails hosted in Openshift pod. We use delayed_job to handle background process, and for delayed_job logging, the application write the log into log/delayed_job.log file. However, if a new pod for the application is created, the pod will create a new file. Also, the company is using Kibana to save every log from Openshift pod.

What we tried so far is put this code in delayed_job_config.rb

Delayed::Worker.logger = Logger.new(STDERR)

To write the log for another process beside delayed job, in order to write the log in Openshift pod log, we use this following code, e.g:

Rails.logger.info "Result: #{ldap.get_operation_result.code}"

However, the delayed_job log is not still appear in Logs tab of the pod (in order for the log to appear in Kibana)

The goal is to write the log in Logs tab of the Openshift pod.

Here's the screenshoot of Logs in Openshift pod :

image

Ruby version : 2.7.1p83
Rails version : 6.0.4.1

UPDATE :

We tried to put Delayed::Worker.logger = Rails.logger in delayed_job_config.rb but still did not work

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

No branches or pull requests

1 participant