I have a worker that needs to retry consuming some messages until an external service is available to store them, which is only available on work hours, but the events can be generated at any time.
Everything is working as expected, and I'm logging both stderr and stout for traceability purposes. This is a business decision and there's now way around it, so no .log files. But symfony messenger seems to be outputting massive amounts of data, mostly related to redelivery and delay stamps, and my logs are getting out of hand.
These outputs have no valuable information and seem to be serialized stamps. And there's thousands of them every hour:
:67:\\\"\\0Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\RedeliveryStamp\\0...
:51:\\\"\\0Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\DelayStamp\\0delay...
I have no custom middlewares and nothing is printed in my own code.
I tried configuring monolog to ignore messenger and doctrine related entries with no luck:
channels: ["!event", "!doctrine", "!messenger", "!security"]
This is what my messenger.yaml looks like:
framework:
messenger:
failure_transport: failed
transports:
failed: 'doctrine://default?queue_name=failed'
async:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
retry_strategy:
max_retries: 14400
delay: 300000
multiplier: 1
max_delay: 300000
options:
queue_name: redacted_queue_name
routing:
'App\Domain\UserCreatedEvent [async]
Am I missing some obvious way to disable this output?
Edit: this is what my monolog.yaml looks like:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
path: "php://stdout"
channels: ["!event", "!doctrine", "!messenger", "!security"]
nested:
type: stream
path: "php://stdout"
channels: ["!event", "!doctrine", "!messenger", "!security"]
console:
level: warning
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!messenger", "!security"]
deprecation:
type: stream
path: "php://stdout"
deprecation_filter:
type: filter
handler: deprecation
max_level: info
channels: ["php"]