Uploaded image for project: 'PHP ORMs'
  1. PHP ORMs
  2. PHPORM-56

Use MongoDB\Driver\Monitoring events for logging

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • laravel-5.0.0
    • Affects Version/s: None
    • Component/s: Laravel
    • None
    • Needed
    • Hide

      Document how to enable logs on connection:

      // Enable log storage
      DB::connection('mongodb')->enableQueryLog();
      
      // Get logs
      $logs = DB::connection('mongodb')->getRawQueryLog();
      

      New in 5.0: The MongoDB commands are logged, not the higher level calls.

      Show
      Document how to enable logs on connection: // Enable log storage DB::connection( 'mongodb' )->enableQueryLog(); // Get logs $logs = DB::connection( 'mongodb' )->getRawQueryLog(); New in 5.0: The MongoDB commands are logged, not the higher level calls.

      Jenssegers\Mongodb\Collection wraps all the calls to the decorated MongoDB\Collection to logging purposes.

      • Use MongoDB\Driver\Monitoring events to log the commands
      • Deprecate and remove Jenssegers\Mongodb\Collection
      • Deprecate and remove Connection::getElapsedTime(). It should not be public.
      • Add integration tests on logged events

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: