8

With Symfony 4.3 and Symfony CLI v4.7.1, when I run:

symfony serve

I see the following warning in the output:

WARNING unable to find the application log

How do I solve the issue that raises this warning? Do I have to install the logger bundle?

Geoffrey
  • 5,407
  • 10
  • 43
  • 78
  • 1
    is that a new project? if so, `mkdir -p var/log; touch dev.log` (as the correct user!) might do the trick (creates the log dir and adds a file for the dev environment) – Jakumi Oct 08 '19 at 19:31
  • tbh, it's hard to tell what the `symfony` tool does, because there is no source code publicly available, hence, I'm only guessing here. – Jakumi Oct 08 '19 at 19:41

4 Answers4

6

I have bumped into the same issue today. For some reason, I had to create an empty log file (dev.log) inside the var/log directory. After that, the warning disappeared and the log messages appeared in the file.

Jan Bodnar
  • 10,969
  • 6
  • 68
  • 77
5

You have to install the "logger" package:

composer require logger
0

I had the same problem. The composer update command in the terminal automatically built all missing files and in particular var/log/dev.log.

Thomas Foster
  • 1,303
  • 1
  • 10
  • 23
0

This might happen when you've altered the default log file path. In my case, I use rotating_file to make sure dev.log doesn't grow too large. rotating_file writes to dev-yyyy-mm-dd.log instead of dev.log. Creating an empty dev.log removes the message.

Jorrit Schippers
  • 1,538
  • 12
  • 17