Pimcore 6 ApplicationLoggerDb service exception

I just updated from Pimcore 5.8.4 to Pimcore 6.0.0. The update in general was really smooth. I just had to register some services in the services.yml and add the console.command tag to my commands…

Unfortunately I’m now facing a problem with the ApplicationLogger. I want to use it with a custom app logger.

I’m creating my own instance of the Logger with the initDbHandler option: ApplicationLogger::getInstance('MessageQueue', true)

Since Pimcore 6 I’m now getting the following Exception: The "Pimcore\Log\Handler\ApplicationLoggerDb" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

If I’m setting the initDbHandler to false I don’t get the exception, but obviously the custom logger is also not working…

Is this a know bug in Pimcore 6.0.0 and is there a workaround?

Thanks for your help!

Seems to me that it is know a known Bug :wink:

Could you create a ticket on github pls?

As a quick fix for yourself: you could create a CompilerPass and make that service Public.

Good to to know :joy:

I created a PR with a one-liner fixing the issue: https://github.com/pimcore/pimcore/pull/4558

Thanks for the tip with the CompilerPass - works like a charm :+1:t3:

That is always a way to fix things :wink: