I am successfully and happily running a Laravel 10 Application in a container, using docker-compose in a development environment and AWS ECS Fargate in production.
This application has tasks scheduled via a cron definition as indicated in official Laravel documentation, which works like a charme.
What I wasn’t expecting was the fact that each time anything is written by a task I get a heading and a trailing row, completely blank.
admin-1 |
admin-1 | INFO No scheduled commands are ready to run.
admin-1 |
The thing in itself is not evil, but I recently tested some cloud monitoring services, and those extra rows increase the amount of data processed by log ingestion, which drives the pricing, and even more annoyingly, you get flooded by empty logs with no meaning, like this for example in Datadog.
Jun 06 11:51:02.286 admin {"service":"admin","source":"stderr","timestamp":1717667462286}
Jun 06 11:51:02.286 admin INFO No scheduled commands are ready to run.
Jun 06 11:51:02.205 admin {"service":"admin","source":"stderr","timestamp":1717667462205}
Cloudwatch, instead, filters them out automatically.
How can I PREVENT the writing of those empty rows in the first place ? Are the empty rows due to a standard formatting used by Laravel ? Is there any way to filter them out ?