I've successfully integrated Doctrine MongoDB module in Zend Framework 2 and now I need to keep track of each query to MongoDB. Does anybody know how to turn on logging?
How to turn on logging (profiling) using ZF2 Doctrine MongoDb module
1.1k Views Asked by Pavel At
2
There are 2 best solutions below
2
slee
On
You can log each query using the MongoDB Database Profiler. Use profile level 2. All queries will be logged to the system.profile collection.
Related Questions in MONGODB
- MongoDb not connecting C#
- How do I link two models in mongoose?
- MERN Stack App - User Avatar Upload - 500 Error After Deployment on Render
- On the server side, it returns undefined but on the client side, logs the values no problem
- Laravel: Using belongsToMany relationship with MongoDB
- What are some MERN projects that will grow me from junior dev to senior
- Save Interface in DB golang
- findOneAndUpdate not updating value in mongodb?
- Get Type Error when using .countDocuments with mongoDB
- Getting a Large Error Output When Calling MongoDB/Mongoose Functions Without an Error Message
- How to enter data in mongodb array at specific position such that if there is only 2 data in array and I want to insert at 5, then rest data is null
- using Python to insert_one to my mongo_db, How do I pass key values into a function?
- SSL Certificate Verification Error When Scraping Website and Inserting Data into MongoDB
- connect ECONNREFUSED 43.205.72.30:27017 while connecting to Atlas
- Vite is probably changing my import path. What should I do?
Related Questions in ZEND-FRAMEWORK2
- ZF2 Action Returns 302 Redirect Instead of 200 OK When Opening Modal View
- Class "Laminas\\View\\HelperPluginManager" not found after migration from zendframework2 to laminas
- Laminas Framework Routing Issue
- Zend Session Error, Session must be started before any output has been sent to browser
- How to use OptionalInputFilter and ways to validate it
- ZF2 / PHPUnit: Mock a Zend/Db/Adapter/Adapter
- In Zend Framework should a script be a service or a controller?
- composer says that zend-serviccemanager 2.7.8 conflicts with zendframework 2.4.0
- using Doctrine With laminas project issue : "Class does not exist"
- What is the method return type declaration for json in zend framework
- How do I alter my unit test to utilise mocks within the setUp function?
- Zend Framework 3 - Module won't load
- getting error while using zend email validation:: PHP Fatal error: Uncaught Error: Class 'Zend\Validator\AbstractValidator'
- Extending module but keep no-overwrite template map
- How can I setup error reporting with Laminas for a development environment?
Related Questions in DOCTRINE-ODM
- MongoDB match aggregation stage with $expr and $in with Doctrine ODM
- Aggregation Query in Symfony & MongoDB
- JWTRefreshTokenBundle generate token for invalid credentials
- Order in Doctrine ODM queryBuilder with preference of fields
- Doctrine MongoDB Entity persisting don't work
- Replace MongoDB $ref with referenced object
- How to filter a collection based on array key value in Doctrine ODM
- How to hydrate related object in Doctrine MongoDB?
- How to write plain match expression in doctrine ODM
- Symfony Doctrine Mongo ODM queryBuilder only returning the first document
- API PLATFORM : How to fix deprecation on anonymous ODM document after change api annotation format?
- Symfony MongoDb default sets empty array instead of not setting field
- Best practice inserting Child in Doctrine without loading parent
- Api-platform 2.7 - Unable to generate an IRI for the item of type
- The annotation "@ODM\Document" in class ... was never imported
Related Questions in DOCTRINE-MONGODB
- Issue get Api Resource with custom id in Api Platform and Synfony
- doctrine-mongodb field mapping
- ParameterNotFound: missing dependency on using staticphp as mapping-type in DoctrineMongoDBBundle
- Sylius grid creation for doctrine mongo
- Doctrine-MongoDB postLoad triggers preUpdate when creating new document
- How to add multiple images to edit form using MongoDB in Sonata?
- Doctrine MongoDB - Hydrate results inside a facet using Doctrine MongoDB Aggregation Builder
- How should I prophesy the sort method?
- symfony4: There is no extension able to load the configuration for "doctrine_mongodb"
- I do not know how to test the create query builder
- Doctrine MongoDB how to get Embedded Document in PersistentArray as its actual class instead of Array
- references class "Doctrine\ODM\MongoDB\UnitOfWork" but no such service exists
- Change mongodb timeout value
- Install doctrine-mongodb-admin-bundle::error:To enable extensions, verify that they are enabled in your .ini files:
- Attempted to load class "ObjectID" from namespace "MongoDB\BSON"
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I just proposed a pull request on the DoctrineMongoODMModule to integrate the logging configuration option of MongoDB ODM. Hopefully it'll be merged soon.
You will then only have to add this in the
doctrine-mongo-odm.global.phpfile :The logger_callable will be called for everything there is to log.