I have a Symfony website that’s something inbetween an actual implementation and staging (it’s used by a special client of mine). The logging is kept ON on that server because that helps when things go wrong from time to time (and they often go wrong in non-obvious, non-error/exception ways). Most of the logged lines are by Doctrine – executed queries, which is very useful to me, but I do manually disable logging for SOME of the huge, repetitive and well-tested operations that spam hundreds of queries, to keep the log easier to navigate, if needed.
My question is: How do I disable logging done from inside of the Symfony messenger component? Specifically, logging done by the doctrine transport (which I use), which spams my log with following lines every second (multiplied by the number of supervisord processes that I run):
[2020-08-24 14:19:25] doctrine.DEBUG: "START TRANSACTION"   [2020-08-24 14:19:25] doctrine.DEBUG: SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE ["2020-08-24 13:19:25","2020-08-24 14:19:25","default"]  [2020-08-24 14:19:25] doctrine.DEBUG: "COMMIT"  
Since these messages are generated by doctrine, I can’t filter them out through logging channels – because that would disable ALL doctrine log messages, and that’s not what I want. I also don’t want to raise the logging level to something higher thatn DEBGUG. I want to remove ONLY these specific messages from the log.
Source: Symfony Questions
Was this helpful?
0 / 0