title: CakePHP 3 Redirect ConsoleOutput to File
body: <p>I am trying to redirect the console output from a shell to a file in CakePHP 3</p>
  
  <p>I found some snippets for CakePHP 2, however, they do not seem to be working...</p>
  
  <p>Here is the code I have so far...</p>
  
  <pre><code>public $rootLogsDirectory = ROOT . DS . 'tmp' . DS . 'logs';
  public $outputName;
  
  public function __construct($stdout = null, $stderr = null, $stdin = null) {
  
      if(!is_dir($this-&gt;rootLogsDirectory)) {
  
          mkdir($this-&gt;rootLogsDirectory);
      }
  
      $this-&gt;outputName = tempnam($this-&gt;rootLogsDirectory, 'cronjobs');
  
      $stdout = new ConsoleOutput('file://' . $this-&gt;outputName . '.out');
      $stderr = new ConsoleOutput('file://' . $this-&gt;outputName . '.err');
  
      $ioNew = new ConsoleIo($stdout, $stderr);
  
      $ioNew-&gt;out('test');
  
      parent::__construct($ioNew);
  }
  </code></pre>
  
  <p>However, <code>$this-&gt;out('hello world')</code> is not being written to the file...</p>