2

symfony/symfony v2.2.0
monolog/monolog v1.4.1

After running composer.phar update yesterday, monolog was updated; running the same command today results in the following error message:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files

  [ErrorException]
  Warning: constant(): Couldn't find constant Monolog\Logger::DEBUG in [path]\vendor\symfony\monolog-bundle\Symfony\Bundle\MonologBundle\DependencyInjection\MonologExtension.php line 109

The (i think) relevant part of config_dev.yml

monolog:
    handlers:
        main:
            type:  stream
            path:  %kernel.logs_dir%/%kernel.environment%.log
            level: debug
        firephp:
            type:  firephp
            level: info

Did something change that requires additional configuration, or is something else happening ?

The Rookie
  • 307
  • 4
  • 11

3 Answers3

15

Monolog recently switch to PSR-4 compatible autoloading. Possibly, the version of Composer you're running is too old for that. Please run composer self-update first and try to update your dependencies again.

cyberfingaz2007
  • 196
  • 3
  • 13
1

I had this same thing, but for Laravel.

I solved it by creating the app/storage folder and all it's sub-folders and files.

I get them by creating a new empty project, and just a copy-paste !

Woking now...


Here is the file structure:

app/storage/cache  
app/storage/logs  
app/storage/meta  
app/storage/sessions  
app/storage/views  

You can ignore this folder for your repository.

0

Sounds like the update didn't go well - do you have a Logger class in vendor/monolog/monolog/src/Monolog/Logger.php? If not I would suggest deleting the vendor/monolog dir and running composer install to get it back.

Seldaek
  • 40,986
  • 9
  • 97
  • 77
  • Even worse: I'm getting an access denied message. Deleting `vendor/monolog` and re-running the update indeed fixed the issue. – The Rookie Apr 02 '13 at 08:56
  • @Seldaek I've tried deleting the repo and installing it back but I still get the exact same error!! And Monolog\Logger::DEBUG exists. – Wissem Mar 23 '14 at 17:45
  • 1
    @Wissem not sure what to tell you, if the constant exist then the class must be ok. Maybe report an issue on github if you can't figure it out, because this is quite vague and not the best place to report detailed information. – Seldaek Mar 23 '14 at 21:25
  • solved it by updating composer: composer self-update – Wissem Mar 27 '14 at 06:46