Fatal error Attempted to load class "MongoClient" from the global namespace
cimo23 opened this issue · comments
Barkati Mohamed commented
bug occur when we use the configuration without ODM Id Service
#1423
monolog:
handlers:
main:
type: mongo
mongo:
host: '127.0.0.1'
port: 27017
user: root
pass: '123456'
database: logsDb
collection: logsCollection
Jordi Boggiano commented
This seems to be a bug in MonologBundle, or a misuse of it. In any case not something I can fix here. See https://github.com/symfony/monolog-bundle/blob/master/DependencyInjection/MonologExtension.php#L282 it uses MongoClient if you don't define a service id. IMO you should pass a service id (it doesn't have to be ODM, just could be a service defining a MongoDB\Client
instance.