title: How to fix Uncaught exception 'ReflectionException' with message 'Class log does not exist'?
body: <p>I am facing an issue with composer on <strong>Windows Server 20012 R2</strong>. I am trying to deploy a website and every time I run <code>composer install</code> or <code>composer update</code> I get the following:</p>
  
  <pre><code>$ composer install
  Loading composer repositories with package information
  Installing dependencies (including require-dev) from lock file
  Nothing to install or update
  Generating autoload files
  &gt; Illuminate\Foundation\ComposerScripts::postInstall
  &gt; php artisan optimize
  Script php artisan optimize handling the post-install-cmd event returned with an error
  
  
    [RuntimeException]
    Error Output:
  
  
  install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [&lt;packages&gt;]...
  </code></pre>
  
  <p>And when I checked the <strong>php error log</strong> I find the following:</p>
  
  <pre><code>[17-Jul-2016 08:04:58 UTC] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class log does not exist' in C:\PATH_TO_PROJECT\vendor\laravel\framework\src\Illuminate\Container\Container.php:734
  Stack trace:
  #0 C:\PATH_TO_PROJECT\vendor\laravel\framework\src\Illuminate\Container\Container.php(734): ReflectionClass-&gt;__construct('log')
  #1 C:\PATH_TO_PROJECT\vendor\laravel\framework\src\Illuminate\Container\Container.php(629): Illuminate\Container\Container-&gt;build('log', Array)
  #2 C:\PATH_TO_PROJECT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(697): Illuminate\Container\Container-&gt;make('log', Array)
  #3 C:\PATH_TO_PROJECT\vendor\laravel\framework\src\Illuminate\Container\Container.php(849): Illuminate\Foundation\Application-&gt;make('Psr\\Log\\LoggerI...')
  #4 C:\PATH_TO_PROJECT\vendor\laravel\framework\src\Illuminate\ in C:\PATH_TO_PROJECT\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 734
  </code></pre>
  
  <p>When I try the same project on an <strong>Ubuntu server</strong> everything works fin! I have tried every answer i could find on the internet, but nothing worked for me. Any advise on how to solve this? And why it is happening?</p>
  
  <p>The windows server PHP version is 5.6.</p>
  
  <p><strong>composer.json</strong> file:</p>
  
  <pre><code>{
      "name": "laravel/laravel",
      "description": "The Laravel Framework.",
      "keywords": ["framework", "laravel"],
      "license": "MIT",
      "type": "project",
      "require": {
          "php": "&gt;=5.5.9",
          "laravel/framework": "5.2.*",
          "intervention/image": "^2.3",
          "greggilbert/recaptcha": "2.*",
          "laravelcollective/html": "5.2.*",
          "vsch/laravel-translation-manager": "*"
      },
      "require-dev": {
          "fzaninotto/faker": "~1.4",
          "mockery/mockery": "0.9.*",
          "phpunit/phpunit": "~4.0",
          "symfony/css-selector": "2.8.*|3.0.*",
          "symfony/dom-crawler": "2.8.*|3.0.*"
      },
      "autoload": {
          "classmap": [
              "database"
          ],
          "psr-4": {
              "App\\": "app/"
          },
           "files": ["app/Http/Helpers/helpers.php"]
      },
      "autoload-dev": {
          "classmap": [
              "tests/TestCase.php"
          ]
      },
      "scripts": {
          "post-root-package-install": [
              "php -r \"copy('.env.example', '.env');\""
          ],
          "post-create-project-cmd": [
              "php artisan key:generate"
          ],
          "post-install-cmd": [
              "Illuminate\\Foundation\\ComposerScripts::postInstall",
              "php artisan optimize"
          ],
          "post-update-cmd": [
              "Illuminate\\Foundation\\ComposerScripts::postUpdate",
              "php artisan optimize"
          ]
      },
      "config": {
          "preferred-install": "dist"
      }
  }
  </code></pre>