<p>I have a deployment object with the following <code>rake jobs:work</code> command:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: staging-delayed-job-deployment
  namespace: staging
spec:
  template:
    metadata:
      labels:
        env: staging
        name: delayed-job
    spec:
      containers:
        - name: job
          image: gcr.io/ej-gc-dev/redacted:&lt;%= ENV['IMAGE_TAG'] %&gt;
          command: ["/bin/bash", "-l", "-c"]
          args: ["RAILS_ENV=production bundle exec rake jobs:work"]
</code></pre>

<p>When I run <code>kubectl logs</code> I get nothing. How do I get the <code>rake jobs:work</code> output to show in <code>kubectl logs</code> ? i.e if run directly in the pod it gives output like this: </p>

<pre><code>[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Starting job worker
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job UpdateHubspotPersonaJob (id=67) RUNNING
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job UpdateHubspotPersonaJob (id=67) COMPLETED after 0.4903
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job Mailerjack.registration_created_user_welcome (id=68) RUNNING
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job Mailerjack.registration_created_user_welcome (id=68) COMPLETED after 0.9115
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job UpdateHubspotPersonaJob (id=69) RUNNING
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job UpdateHubspotPersonaJob (id=69) COMPLETED after 0.1752
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job Mailerjack.registration_created_user_welcome (id=70) RUNNING
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] Job Mailerjack.registration_created_user_welcome (id=70) COMPLETED after 0.4770
[Worker(host:staging-deployment-cc7dc559f-bswvr pid:2381)] 4 jobs processed at 1.7649 j/s, 0 failed
</code></pre>

<p>I want that to show up when I run <code>kubectl logs</code> </p>

<p>I needed to add an initializer: <code>config/initializers/delayed_job.rb</code> and set the worker's logger to stdout like so: </p>

<p><code>Delayed::Worker.logger = Logger.new(STDOUT)</code></p>
