<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -44,6 +44,10 @@ module Mongo
       @pk_factory = pk_factory || ObjectID
       @hint = nil
     end
+    
+    def logger
+      db.logger
+    end
 
     # Get a sub-collection of this collection by name.
     #</diff>
      <filename>lib/mongo/collection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,9 @@
 # limitations under the License.
 # ++
 
-require 'test/test_helper'
+require 'test_helper'
+require 'logger'
+
 class TestCollection &lt; Test::Unit::TestCase
   @@connection = Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost', ENV['MONGO_RUBY_DRIVER_PORT'] || Connection::DEFAULT_PORT)
   @@db   = @@connection.db('ruby-mongo-test')
@@ -73,6 +75,18 @@ class TestCollection &lt; Test::Unit::TestCase
       assert_equal [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], @@test.distinct(&quot;b.c&quot;).sort
     end
   end
+  
+  def test_logger
+    output = StringIO.new
+    logger = Logger.new(output)
+    logger.level = Logger::DEBUG
+    db = Connection.new(@host, @port, :logger =&gt; logger).db('ruby-mongo-test')
+    collection = db['test']
+    assert_equal logger, collection.logger
+    
+    collection.logger.debug 'testing'
+    assert output.string.include?('testing')
+  end
 
   def test_safe_insert
     a = {&quot;hello&quot; =&gt; &quot;world&quot;}</diff>
      <filename>test/test_collection.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1d9352179039ee5a3b393677774c4c33d46d675a</id>
    </parent>
  </parents>
  <author>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </author>
  <url>http://github.com/jnunemaker/mongo-ruby-driver/commit/5581481eaa122f429d513bcce3c3a296e8defb6b</url>
  <id>5581481eaa122f429d513bcce3c3a296e8defb6b</id>
  <committed-date>2009-10-31T05:44:46-07:00</committed-date>
  <authored-date>2009-10-31T05:44:46-07:00</authored-date>
  <message>Added logger convenience method on collection.</message>
  <tree>60c323a8c7041472d9810e016216b53caac140e4</tree>
  <committer>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </committer>
</commit>
