Shinsuke Sugaya %!s(int64=11) %!d(string=hai) anos
pai
achega
0ce981c907

+ 45 - 0
src/main/java/jp/sf/fess/log/MobyletLoggerImpl.java

@@ -0,0 +1,45 @@
+/*
+ * Copyright 2009-2014 the CodeLibs Project and the Others.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+
+package jp.sf.fess.log;
+
+import org.mobylet.core.log.MobyletLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MobyletLoggerImpl implements MobyletLogger {
+    private static final Logger logger = LoggerFactory.getLogger("org.mobylet");
+
+    private final boolean loggable;
+
+    public MobyletLoggerImpl() {
+        final String value = System.getProperty("mobylet.log");
+        loggable = "true".equalsIgnoreCase(value);
+    }
+
+    @Override
+    public boolean isLoggable() {
+        return loggable;
+    }
+
+    @Override
+    public void log(final String msg) {
+        if (loggable) {
+            logger.info(msg);
+        }
+    }
+
+}

+ 4 - 0
src/main/mysql/webapp/WEB-INF/web.xml

@@ -42,6 +42,10 @@
       <param-name>encoding</param-name>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
       <param-value>UTF-8</param-value>
     </init-param>
     </init-param>
+    <init-param>
+      <param-name>mobylet.logger.class</param-name>
+      <param-value>jp.sf.fess.log.MobyletLoggerImpl</param-value>
+    </init-param>
   </filter>
   </filter>
 
 
   <filter>
   <filter>

+ 4 - 0
src/main/oracle/webapp/WEB-INF/web.xml

@@ -42,6 +42,10 @@
       <param-name>encoding</param-name>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
       <param-value>UTF-8</param-value>
     </init-param>
     </init-param>
+    <init-param>
+      <param-name>mobylet.logger.class</param-name>
+      <param-value>jp.sf.fess.log.MobyletLoggerImpl</param-value>
+    </init-param>
   </filter>
   </filter>
 
 
   <filter>
   <filter>

+ 3 - 2
src/main/resources/fess_suggest.dicon

@@ -114,13 +114,14 @@
 	</component>
 	</component>
 
 
 	<!-- Solr Server Configuration -->
 	<!-- Solr Server Configuration -->
-	<component name="suggestInterceptor" class="org.codelibs.solr.lib.server.interceptor.PreemptiveAuthInterceptor">
+	<component name="suggestInterceptor" class="org.codelibs.solr.lib.server.interceptor.PreemptiveAuthInterceptor"
+		autoBinding="none">
 	</component>
 	</component>
 	<component name="suggestCredentials" class="org.apache.http.auth.UsernamePasswordCredentials">
 	<component name="suggestCredentials" class="org.apache.http.auth.UsernamePasswordCredentials">
 		<arg>"solradmin"</arg><!-- Username -->
 		<arg>"solradmin"</arg><!-- Username -->
 		<arg>"solradmin"</arg><!-- Password -->
 		<arg>"solradmin"</arg><!-- Password -->
 	</component>
 	</component>
-	<component name="suggestHttpClient" class="org.apache.http.impl.client.DefaultHttpClient">
+	<component name="suggestHttpClient" class="org.apache.http.impl.client.DefaultHttpClient" autoBinding="none">
 		<arg>clientConnectionManager</arg>
 		<arg>clientConnectionManager</arg>
 	</component>
 	</component>
 	<component name="suggestSolrServer" class="org.apache.solr.client.solrj.impl.HttpSolrServer">
 	<component name="suggestSolrServer" class="org.apache.solr.client.solrj.impl.HttpSolrServer">

+ 3 - 2
src/main/resources/solrlib.dicon

@@ -92,13 +92,14 @@
 	</component>
 	</component>
 
 
 	<!-- Solr Server Configuration -->
 	<!-- Solr Server Configuration -->
-	<component name="interceptor1" class="org.codelibs.solr.lib.server.interceptor.PreemptiveAuthInterceptor">
+	<component name="interceptor1" class="org.codelibs.solr.lib.server.interceptor.PreemptiveAuthInterceptor"
+		autoBinding="none">
 	</component>
 	</component>
 	<component name="credentials1" class="org.apache.http.auth.UsernamePasswordCredentials">
 	<component name="credentials1" class="org.apache.http.auth.UsernamePasswordCredentials">
 		<arg>"solradmin"</arg><!-- Username -->
 		<arg>"solradmin"</arg><!-- Username -->
 		<arg>"solradmin"</arg><!-- Password -->
 		<arg>"solradmin"</arg><!-- Password -->
 	</component>
 	</component>
-	<component name="httpClient1" class="org.apache.http.impl.client.DefaultHttpClient">
+	<component name="httpClient1" class="org.apache.http.impl.client.DefaultHttpClient" autoBinding="none">
 		<arg>clientConnectionManager</arg>
 		<arg>clientConnectionManager</arg>
 	</component>
 	</component>
 	<component name="solrServer1" class="org.apache.solr.client.solrj.impl.HttpSolrServer">
 	<component name="solrServer1" class="org.apache.solr.client.solrj.impl.HttpSolrServer">

+ 4 - 0
src/main/webapp/WEB-INF/web.xml

@@ -42,6 +42,10 @@
       <param-name>encoding</param-name>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
       <param-value>UTF-8</param-value>
     </init-param>
     </init-param>
+    <init-param>
+      <param-name>mobylet.logger.class</param-name>
+      <param-value>jp.sf.fess.log.MobyletLoggerImpl</param-value>
+    </init-param>
   </filter>
   </filter>
 
 
   <filter>
   <filter>