News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Hannes Magnusson:
Query logging and profiling in MongoDB
September 18, 2013 @ 10:25:49

in a previous post Hannes Magnusson introduced the new stream handling notification feature in the MongoDB PHP extension. In his most recent post he elaborates on a subject mentioned in the previous post - query logging and profiling.

In my previous blog post I mentioned that the 1.5.0 release of the MongoDB driver for PHP has improved notification support using the PHP Notification API, and showed off a fairly useless (but fun) progress bar. Now its time for a little bit more practical examples using this system: Query logging and profiling.

He talks about some of the features in his pull request, including the new constants added to help make working with the logging on streams easier. He includes some sample code that handles the logging via an "update" callback function, parsing the log message type and save the related data to a class variable. An instance of this class is then assigned to the "notification" stream and passed in as an additional option when creating the MongoClient connection. He includes an example of querying a basic collection and how to extract the request information from the logging object instance.

0 comments voice your opinion now!
mongodb stream context tutorial log query profile notification api

Link: http://bjori.blogspot.com/2013/09/query-logging-and-profiling-in-mongodb.html

blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Methods to Reduce the Load of Your Webserver by Caching Content

Web Developer Juice: 11 easy steps for installing Apache ActiveMQ and configuring it for PHP applica

ParanoidFerret.com: Flex & PHP Tutorial - Transmitting data using JSON

Padraic Brady's Blog: The PHPSpec 0.2.0devel API

DZone.com: MySQL PHP search: four-part video tutorial series


Community Events





Don't see your event here?
Let us know!


framework laravel api library series podcast release community interview zendserver deployment list conference developer voicesoftheelephpant language symfony bugfix tips introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework