New in Symfony 3.3: Persisted deprecation logs

Warning: This post is about an unsupported Symfony version. Some of this information may be out of date. Read the most recent Symfony Docs.

Contributed by
Thomas Perez and Nicolas Grekas
in #21502.

Backward compatibility promise is one of the best features of Symfony. This promise ensures that your applications will always work when upgrading them using the same Symfony branch (e.g. an app using Symfony 3.0 will work when upgrading Symfony to 3.1, 3.2, 3.3 and 3.4).

The key of the backward compatibility promise are the deprecation messages. Whenever you use a feature that will be changed or removed in the next versions of Symfony, you get a log message warning you about this and providing alternative solutions. For example, this image shows the Web Debug Toolbar warning you about five deprecation messages:

However, some of those deprecation messages are only generated during the compilation of the service container. That's why they disappear if you reload the page and they only appear again if you delete the cache to force a new compilation of the container.

In Symfony 3.3 we decided to fix this problem and now all deprecation messages are persisted. No matter if they were generated during the compilation phase or while serving the request. The Web Debug Toolbar and the Profiler now always display all the deprecation messages:

In addition to persisting the deprecation messages, Symfony 3.3 will also display the full logs generated during the compilation phase. You don't usually need to care about those messages, but they can help you with hard to debug issues:

Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.


Thanks Thomas and Nicolas for this nice improvement! The disappearing deprecation logs always frustrated me.
Énorme merci
Small improvements matter, thanks
Thanks for that improvement! It will save us time.
Nice !
This is very important thanks! I would even go as far as to suggest a separate deprecation.log in var/logs because sometimes its hard to use the awesome Web Debug Toolbar e.g in the case of client side frameworks. I've also ran into cases where deprecation notices are made on a request basis so a dedicate log will always catch them.

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.