title: Redirect all output of the java program to log file
body: <p>I have scheduled my <code>jar</code> file by saving this line at the end of the <code>crontab</code>:</p>
  
  <pre><code>30 12 * * * java -jar test.jar &gt; test.log (I have also tried test.txt)
  </code></pre>
  
  <p>Cron has started the job, also created the log file, but there is nothing in that file. Any idea why is that? I am doing <code>System.out.println()</code> in my program.</p>
  
  <p>I have added write permissions to everyone for that file.</p>
  
  <p>Could it happen that the scheduler crashed before the app even started? When I have checked log of the <code>crontab</code> by executing <code>grep CRON /var/log/syslog</code> it gave me fine looking output, no error indication:</p>
  
  <pre><code>Sep  2 12:19:01 ip-172-31-18-162 CRON[2308]: (root) CMD (java -jar /opt/bitnami/apache-tomcat/webapps/apps/FullEmailReport/DJOF_FullEmail_DynamicContentReport_ScheduledPart.jar &gt; /opt/bitnami/apache-tomcat/webapps/apps/FullEmailReport/data/app.txt)
  </code></pre>