<p>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 <code>log/delayed_job.log</code> 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.</p>
<p>What we tried so far is put this code in <code>delayed_job_config.rb</code></p>
<p><code>Delayed::Worker.logger = Logger.new(STDERR)</code></p>
<p>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:</p>
<p><code>Rails.logger.info &quot;Result: #{ldap.get_operation_result.code}&quot;</code></p>
<p>However, the delayed_job log is not still appear in Logs tab of the pod (in order for the log to appear in Kibana)</p>
<p>The goal is to write the log in Logs tab of the Openshift pod.</p>
<p><a href="https://i.stack.imgur.com/EcYlJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EcYlJ.png" alt="enter image description here" /></a></p>
<p>Any help is appreciated.</p>
<p>UPDATE :</p>
<p>We tried to put <code>Delayed::Worker.logger = Rails.logger</code> in <code>delayed_job_config.rb</code> but still did not work</p>

Satria Janaka
<p>In case it might help anyone:</p>
<p>We're ended up muting the DelayedJobs ActiveRecord related logs
playing around <a href="https://github.com/collectiveidea/delayed_job/issues/477#issuecomment-800341818" rel="nofollow noreferrer">this delayed_job repo post</a> to also ensure that if an error occurs, we get the previous log level back</p>
<p>And within our container, we tail the actual delayed job log file to output to get the actual jobs log</p>
<blockquote>
<p>tail -f /app/log/production.log &amp;</p>
</blockquote>
<p>It's not optimal, but at least, we get to see the logs!</p>
