title: Writing to custom log aswell as laravel.log in laravel 5
body: <p>Im trying to write a custom log for my laravel application, as the application is quite large so I want to organise my log files.</p>
  
  <p>The issue is, if at any point the application errors, it writes to the <code>laravel.log</code> file and kills the script, as php does.</p>
  
  <p>So for example, I have a custom log library like so</p>
  
  <pre><code>&lt;?php
  
  namespace App\Libraries\Logs;
  
  use Monolog\Logger;
  use Monolog\Handler\StreamHandler;
  
  use Log;
  
  class CustomLogsLibrary {
  
      public function userError($error){
  
          $orderLog = new Logger('users');
          $orderLog-&gt;pushHandler(new StreamHandler(storage_path('logs/users.log')), Logger::INFO);
          $orderLog-&gt;info('Error 1', $error);
  
      }
  
  }
  </code></pre>
  
  <p>and then if this is my script</p>
  
  <pre><code>    $user = new User;
      $user-&gt;nae = $request-&gt;name; //Name spelt wrong on purpose
      $user-&gt;email = $request-&gt;email;
      $user-&gt;password = bcrypt($request-&gt;password);
      if(!$user-&gt;save()){
          $errorCode = (new CustomLogsLibrary)-&gt;userError($user-&gt;save()); 
      }
  </code></pre>
  
  <p>As you can probably see i've spelt 'name' wrong in the user object to force an error.</p>
  
  <p>Laravel then errors on the misspelt name and dies, meaning it never actually reaches my custom log function, instead it logs</p>
  
  <blockquote>
    <p>Column not found: 1054 Unknown column 'nme' in 'field list'</p>
  </blockquote>
  
  <p>to <code>laravel.log</code> and then dies. I know it will hit the function if the <code>false</code> is returned, but when false is not returned and the function errors for a different reason, I still want to log it in a custom file.</p>
  
  <p>How do I get around this?</p>
  
  <p>I want to be able to organise all errors into separate files, and prioritise  writing to those files over the standard <code>laravel.log</code> file.</p>