You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ry...@apache.org on 2007/05/03 02:23:44 UTC

svn commit: r534664 - /lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java

Author: ryan
Date: Wed May  2 17:23:44 2007
New Revision: 534664

URL: http://svn.apache.org/viewvc?view=rev&rev=534664
Log:
SOLR-212  java.util.logging.config.file must be set before getInstanceDir()

Modified:
    lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java

Modified: lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java?view=diff&rev=534664&r1=534663&r2=534664
==============================================================================
--- lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java (original)
+++ lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java Wed May  2 17:23:44 2007
@@ -86,22 +86,11 @@
    */
   public DirectSolrConnection( String instanceDir, String dataDir, String loggingPath )
   {
-    // Set the instance directory
-    if( instanceDir != null ) {
-      if( Config.isInstanceDirInitialized() ) {
-        String dir = Config.getInstanceDir();
-        if( !dir.equals( instanceDir ) ) {
-          throw new SolrException( 500, "already initalized: "+dir  );
-        }
-      }
-      Config.setInstanceDir( instanceDir );
-    }
-    
-    // If a loggingPath is specified, try using that
+    // If a loggingPath is specified, try using that (this needs to happen first)
     if( loggingPath != null ) {
       File loggingConfig = new File( loggingPath );
-      if( !loggingConfig.exists() ) {
-        loggingConfig = new File( new File(Config.getInstanceDir()), loggingPath  );
+      if( !loggingConfig.exists() && instanceDir != null ) {
+        loggingConfig = new File( new File(instanceDir), loggingPath  );
       }
       if( loggingConfig.exists() ) {
         System.setProperty("java.util.logging.config.file", loggingConfig.getAbsolutePath() ); 
@@ -109,6 +98,17 @@
       else {
         throw new SolrException( 500, "can not find logging file: "+loggingConfig );
       }
+    }
+    
+    // Set the instance directory
+    if( instanceDir != null ) {
+      if( Config.isInstanceDirInitialized() ) {
+        String dir = Config.getInstanceDir();
+        if( !dir.equals( instanceDir ) ) {
+          throw new SolrException( 500, "already initalized: "+dir  );
+        }
+      }
+      Config.setInstanceDir( instanceDir );
     }
     
     // If the Data directory is specified, initalize SolrCore directly