Closed petrw1 closed 3 years ago
Happens to me too in 4.4.3.
That's because the "logger" service is private since Symfony 3.4, and we are trying to access it from the container: https://github.com/sonata-project/SonataAdminBundle/blob/a74dcbb5b5d2bf9fd9d4cb02e86e8da52526c4bc/src/Controller/CRUDController.php#L1197-L1207
As a workaround, you could try to override the service definition in order to make it public:
services:
logger:
alias: 'monolog.logger'
public: true
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@phansys I'm sorry to open this stale issue, but would it be an idea to leverage Psr\Log\LoggerAwareInterface
in the CRUDController?
Hi, I want to log errors in Sonata admin. But logger is always used NullLogger. In my project, I use monolog logger and it is accessible from container. But in Sonata Admin it is not in the container. Do I need to set it explicitly for Sonata or there is some bug?
Environment
Sonata packages
Symfony packages
PHP version
Subject
Logger is not present in container
Expected results
Logger is in container