-
-
Notifications
You must be signed in to change notification settings - Fork 116
[MCP Bundle] Fix services when monolog is not installed #849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MCP Bundle] Fix services when monolog is not installed #849
Conversation
|
@chr-hertel tell me what you think about this solution, but while working on it I was thinking that just require monolog could be even better. I don't see any good reason to not use it. |
|
I think that solution works for me - is this the only place where we'd need that tho? I also wonder about the implementation in the ai/src/mcp-bundle/src/McpBundle.php Lines 113 to 134 in 806d6be
@camilleislasse do you recall why it's |
| return static function (ContainerConfigurator $container): void { | ||
| $container->services() | ||
| ->set('monolog.logger.mcp') | ||
| if (class_exists(\Symfony\Bundle\MonologBundle\MonologBundle::class)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use in import here instead the FCQN:
| if (class_exists(\Symfony\Bundle\MonologBundle\MonologBundle::class)) { | |
| if (class_exists(MonologBundle::class)) { |
Fixes symfony#830 - Wrap monolog.logger.mcp service creation in class_exists() check - Add ->nullOnInvalid() to setLogger() call - Uniformize logger references in McpCommand and McpController - Update test to skip when MonologBundle is not installed Builds on symfony#849 by @WebMamba
@chr-hertel I don't recall why, probably a mistake on my part |
|
Closing in favor of #864 Thanks |
|
thank's @WebMamba |
As said on the issue, when monolog is not installed, the container can't compile the services.
The solution here is to register the service only if the bundle is installed