0

I have a Symfony 5.3 application. When the container is compiled, the following file appears:

var/cache/dev/App_KernelDevDebugContainerDeprecations.log

In contains a serialized list of deprecation messages:

a:13:{i:0;a:6:{s:4:"type";i:16384;s:7:"message";s:166:"Since symfony/security-guard 5.3: ...

Is there a way to display this deprecation log in human-readable format? I could not find a bin/console command to do that.

Also, is the output location/format of this deprecation log configured somewhere? It does not seem to follow the monolog config that applies to the rest of the project.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • @yivi I found this link already, and it does not seem to answer my question. I have the monolog handlers set, but the file output during container compilation (`App_KernelDevDebugContainerDeprecations.log`) does not match the configured monolog file format `%kernel.environment%.deprecations.log`. – BenMorel Dec 07 '21 at 16:15
  • That's not the log. That's output for the profiler. It's on the cache directory, not on the log directory. If you want a deprecation log, use the directions in the linked QA. If you have already configured monolog to create a deprecation log and you are not getting, please edit your question to include your monolog configuration. – yivi Dec 07 '21 at 16:25
  • @yivi Interesting, thanks. Indeed, the deprecations are also reflected in the configured log file in the `log` directory. – BenMorel Dec 07 '21 at 16:29
  • @yivi Do you want to add the profiler information as an answer to this question? – BenMorel Dec 07 '21 at 16:30

1 Answers1

2

The file you are seeing is not the deprecation log, but a serialized output that the Symfony Profiler will use to show this information on dev.

Notice that sits on the cache/build directory (var/cache), and not on the log directory (var/log).

To configure Monolog to log deprecations, use the directions you'll find here, for example. You'll notice that the resulting log ends up where you point it to, and the result will be a regular log file in mostly readable format.

yivi
  • 42,438
  • 18
  • 116
  • 138