title: How to write docker cron logs to stdout/stderr
body: <p>I have docker where cron is ran using
  <code>CMD [&quot;cron&quot;,&quot;-f&quot;]</code> command. This writes the output to the cron log file.</p>
  <p>Is there any way to redirect these logs to the console.</p>
  <p>My Base Image looks like</p>
  
  <pre class="lang-dockerfile prettyprint-override"><code>FROM ubuntu:latest
  RUN ls
  
  RUN apt-get update
  RUN apt install -y software-properties-common
  RUN add-apt-repository -y ppa:openjdk-r/ppa
  RUN apt-get update
  RUN apt-get install -y openjdk-12-jre
  
  RUN apt-get -y install cron wget unzip
  
  
  
  RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
      &amp;&amp; echo &quot;deb http://dl.google.com/linux/chrome/deb/ stable main&quot; &gt;&gt; /etc/apt/sources.list.d/google-chrome.list \
      &amp;&amp; apt-get update -qqy \
      &amp;&amp; apt-get -qqy install google-chrome-stable \
      &amp;&amp; rm /etc/apt/sources.list.d/google-chrome.list \
      &amp;&amp; rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
      &amp;&amp; sed -i 's/&quot;$HERE\/chrome&quot;/&quot;$HERE\/chrome&quot; --no-sandbox/g' /opt/google/chrome/google-chrome
  
  
  ARG CHROME_DRIVER_VERSION=76.0.3809.68
  RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
      &amp;&amp; rm -rf /opt/chromedriver \
      &amp;&amp; unzip /tmp/chromedriver_linux64.zip -d /opt \
      &amp;&amp; rm /tmp/chromedriver_linux64.zip \
      &amp;&amp; mv /opt/chromedriver /opt/chromedriver-$CHROME_DRIVER_VERSION \
      &amp;&amp; chmod 755 /opt/chromedriver-$CHROME_DRIVER_VERSION \
      &amp;&amp; ln -fs /opt/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
  
  COPY tests-cron /etc/cron.d/tests-cron
  RUN chmod 0644 /etc/cron.d/tests-cron
  WORKDIR /etc/cron.d
  RUN ls
  RUN crontab /etc/cron.d/tests-cron
  
  RUN touch /var/log/cron.log
  
  
  
  WORKDIR /app
  RUN mkdir pricetest
  
  COPY --from=maven-container /app/ pricetest/
  RUN cp /usr/bin/chromedriver ./pricetest
  
  WORKDIR /app/pricetest
  ENV SHELL=/bin/bash
  
  CMD [&quot;cron&quot;, &quot;-f&quot;]
  </code></pre>
  <p>PS: I am still work in progress on this project. So I havent optimized the docker build.</p>
  <p>And the cronfile ( <code>tests-cron</code> )  I am contains</p>
  <pre class="lang-dockerfile prettyprint-override"><code>* * * * * root echo &quot;Hello world&quot;
  </code></pre>
  <p>Base image used: <code>ubuntu:latest</code></p>