<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,9 +1,12 @@
 == 0.11
 * Added Sunspot::Rails::Server class to  start/stop/run/bootstrap the solr server
+* Added log_level key to sunspot.yml, see java docs for valid values (http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/Level.html)
+* Added log_file key to sunspot.yml. This defaults to RAILS_ROOT/log/solr_&lt;environment&gt;.log.
 
 == 0.10.6
 * Added script/generate sunspot support to generate the required sunspot.yml
   file [Brandon Keepers]
+  
 == 0.10.5
 * Added a auto_commit_after_request option to sunspot.yml. Sunspot will not
   automatically commit any changes in solr if you set this value to false.</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -205,6 +205,35 @@ remove those documents from the index, use +clean_index_orphans+. Note that
 neither of these operations should be needed if Sunspot and Sunspot::Rails are
 used as intended.
 
+
+== Testing Solr integration using RSpec
+
+To disable the sunspot-solr integration for your active record models, add the
+following line to your spec_helper.rb
+
+require 'sunspot/spec/extension'
+
+This will disable all automatic after_save/after_destroy solr-requests generated
+via the #searchable method. This will not disable/mock explicit calls in your code.
+
+If you want to test the sunspot-solr integration with active record, you can 
+reenable the after_save/after_destroy hooks by adding 'integrate_sunspot' in your
+examples.
+
+  describe Searches do
+    integrate_sunspot
+    
+    before(:each) do
+      @movie = Factory.create :movie
+    end
+    
+    it &quot;should find a movie&quot; do
+      Movie.search { keywords @movie.title }.first.should == @movie
+    end
+  end
+
+
+
 == Further Reading
 
 Reading the {Sunspot documentation}[http://outoftime.github.com/sunspot/docs] is</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,18 @@
-common: &amp;common
+production:
   solr:
     hostname: localhost
     port: 8983
-
-production:
-  &lt;&lt;: *common
-  solr:
-    path: /solr/myindex
+    log_level: WARNING
 
 development:
-  &lt;&lt;: *common
   solr:
+    hostname: localhost
     port: 8982
+    log_level: INFO
 
 test:
-  &lt;&lt;: *common
   solr:
-    port: 8981
\ No newline at end of file
+    hostname: localhost
+    port: 8981
+    log_level: WARNING
+    
\ No newline at end of file</diff>
      <filename>generators/sunspot/templates/sunspot.yml</filename>
    </modified>
    <modified>
      <diff>@@ -76,6 +76,17 @@ module Sunspot #:nodoc:
         @log_level ||= (user_configuration_from_key('solr', 'log_level') || 'INFO')
       end
       
+      #
+      # The log directory for solr logfiles
+      #
+      # ==== Returns
+      # 
+      # String:: log_dir
+      #
+      def log_file
+        @log_file ||= (user_configuration_from_key('solr', 'log_file') || default_log_file_location )
+      end
+      
       # 
       # The solr home directory. Sunspot::Rails expects this directory
       # to contain a config, data and pids directory. See 
@@ -104,6 +115,18 @@ module Sunspot #:nodoc:
       
       private
       
+      #
+      # Logging in rails_root/log as solr_&lt;environment&gt;.log as a 
+      # default.
+      #
+      # ===== Returns
+      #
+      # String:: default_log_file_location
+      #
+      def default_log_file_location
+        File.join(::Rails.root, 'log', &quot;solr_&quot; + ::Rails.env + &quot;.log&quot;)
+      end
+      
       # 
       # return a specific key from the user configuration in config/sunspot.yml
       #</diff>
      <filename>lib/sunspot/rails/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ module Sunspot #:nodoc:
     class Server
       
       class &lt;&lt; self
-        delegate :port, :solr_home, :to =&gt; :configuration
+        delegate :log_file, :log_level, :port, :solr_home, :to =&gt; :configuration
         
         # Name of the sunspot executable (shell script)
         SUNSPOT_EXECUTABLE = (RUBY_PLATFORM =~ /w(in)?32$/ ? 'sunspot-solr.bat' : 'sunspot-solr')
@@ -116,7 +116,7 @@ module Sunspot #:nodoc:
         # Array:: sunspot_start_command
         #
         def start_command
-          [ SUNSPOT_EXECUTABLE, 'start', '--', '-p', port.to_s, '-d', data_path, '-s', solr_home ]
+          [ SUNSPOT_EXECUTABLE, 'start', '--', '-p', port.to_s, '-d', data_path, '-s', solr_home, '-l', log_level, '-lf', log_file ]
         end
 
         #
@@ -141,6 +141,18 @@ module Sunspot #:nodoc:
           [ SUNSPOT_EXECUTABLE, 'run' ]
         end
         
+        #
+        # access to the Sunspot::Rails::Configuration, defined in
+        # sunspot.yml. Use Sunspot::Rails.configuration if you want
+        # to access the configuration directly.
+        #
+        # ==== returns
+        #
+        # Sunspot::Rails::Configuration:: configuration
+        #
+        def configuration
+          Sunspot::Rails.configuration
+        end
         
         private 
         
@@ -186,19 +198,6 @@ module Sunspot #:nodoc:
             FileUtils.cp( config_file, config_path )
           end
         end
-        
-        #
-        # access to the Sunspot::Rails::Configuration, defined in
-        # sunspot.yml. Use Sunspot::Rails.configuration if you want
-        # to access the configuration directly.
-        #
-        # ==== returns
-        #
-        # Sunspot::Rails::Configuration:: configuration
-        #
-        def configuration
-          Sunspot::Rails.configuration
-        end
       end
     end
   end</diff>
      <filename>lib/sunspot/rails/server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,11 +18,15 @@ describe Sunspot::Rails::Configuration, &quot;default values&quot; do
     @config.port.should == 8983
   end
 
-  it &quot;should handle the 'log_level' propery when not set&quot; do
+  it &quot;should handle the 'log_level' property when not set&quot; do
     @config.log_level.should == 'INFO'
   end
   
-  it &quot;should handle the 'solr_home' propery when not set&quot; do
+  it &quot;should handle the 'log_file' property&quot; do
+    @config.log_file.should =~ /log\/solr_test.log/
+  end
+  
+  it &quot;should handle the 'solr_home' property when not set&quot; do
     Rails.should_receive(:root).at_least(1).and_return('/some/path')
     @config.solr_home.should == '/some/path/solr'
   end</diff>
      <filename>spec/configuration_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -54,23 +54,37 @@ describe Sunspot::Rails::Server do
       Sunspot::Rails::Server.should_receive(:configuration).and_return(@sunspot_configuration)
     end
 
-    it &quot;should delegate the port command to the configuration&quot; do
+    it &quot;should delegate the port method to the configuration&quot; do
       @sunspot_configuration.should_respond_to_and_receive(:port).and_return(1234)
       Sunspot::Rails::Server.port.should == 1234
     end
     
-    it &quot;should delegate the solr_home command to the configuration&quot; do
+    it &quot;should delegate the solr_home method to the configuration&quot; do
       @sunspot_configuration.should_respond_to_and_receive(:solr_home).and_return('/some/path')
       Sunspot::Rails::Server.solr_home.should == '/some/path'
     end
+    
+    it &quot;should delegate the log_level method to the configuration&quot; do
+      @sunspot_configuration.should_respond_to_and_receive(:log_level).and_return('LOG_LEVEL')
+      Sunspot::Rails::Server.log_level.should == 'LOG_LEVEL'
+    end
+
+    it &quot;should delegate the log_dir method to the configuration&quot; do
+      @sunspot_configuration.should_respond_to_and_receive(:log_file).and_return('log_file')
+      Sunspot::Rails::Server.log_file.should =~ /log_file/
+    end
+
   end
 
   describe &quot;protected methods&quot; do
     it &quot;should generate the start command&quot; do
-      Sunspot::Rails::Server.should_receive(:port).and_return('1')
-      Sunspot::Rails::Server.should_receive(:solr_home).and_return('home')
-      Sunspot::Rails::Server.should_receive(:data_path).and_return('data')
-      Sunspot::Rails::Server.send(:start_command).should == [ 'sunspot-solr', 'start', '--', '-p', '1', '-d', 'data', '-s', 'home' ]
+      Sunspot::Rails::Server.should_respond_to_and_receive(:port).and_return('1')
+      Sunspot::Rails::Server.should_respond_to_and_receive(:solr_home).and_return('home')
+      Sunspot::Rails::Server.should_respond_to_and_receive(:data_path).and_return('data')
+      Sunspot::Rails::Server.should_respond_to_and_receive(:log_level).and_return('LOG')
+      Sunspot::Rails::Server.should_respond_to_and_receive(:log_file).and_return('log_file')
+      Sunspot::Rails::Server.send(:start_command).should == \
+          [ 'sunspot-solr', 'start', '--', '-p', '1', '-d', 'data', '-s', 'home', '-l', 'LOG', '-lf', 'log_file' ]
     end
   
     it &quot;should generate the stop command&quot; do</diff>
      <filename>spec/server_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
      &quot;README.rdoc&quot;
   ]
   s.files = [
-    &quot;History.txt&quot;,
+     &quot;History.txt&quot;,
      &quot;LICENSE&quot;,
      &quot;MIT-LICENSE&quot;,
      &quot;MIT-LICENSE&quot;,</diff>
      <filename>sunspot_rails.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>52981cd9dac058f49ded17786de93456c81ad4fb</id>
    </parent>
  </parents>
  <author>
    <name>Benjamin Krause</name>
    <email>bk@benjaminkrause.com</email>
  </author>
  <url>http://github.com/outoftime/sunspot_rails/commit/a5f6dbf312a81383fbfd861b33729ed5e144ec64</url>
  <id>a5f6dbf312a81383fbfd861b33729ed5e144ec64</id>
  <committed-date>2009-09-16T05:18:31-07:00</committed-date>
  <authored-date>2009-09-16T05:18:31-07:00</authored-date>
  <message>added log_level/log_file to sunspot_rails</message>
  <tree>96e1c55822f469c23d5a427029fc78428ad5145b</tree>
  <committer>
    <name>Benjamin Krause</name>
    <email>bk@benjaminkrause.com</email>
  </committer>
</commit>
