This commit is contained in:
Shinsuke Sugaya 2014-01-25 23:02:01 +09:00
parent 767ebbf078
commit 0ce981c907
6 changed files with 63 additions and 4 deletions

View file

@ -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);
}
}
}

View file

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

View file

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

View file

@ -114,13 +114,14 @@
</component>
<!-- 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 name="suggestCredentials" class="org.apache.http.auth.UsernamePasswordCredentials">
<arg>"solradmin"</arg><!-- Username -->
<arg>"solradmin"</arg><!-- Password -->
</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>
</component>
<component name="suggestSolrServer" class="org.apache.solr.client.solrj.impl.HttpSolrServer">

View file

@ -92,13 +92,14 @@
</component>
<!-- 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 name="credentials1" class="org.apache.http.auth.UsernamePasswordCredentials">
<arg>"solradmin"</arg><!-- Username -->
<arg>"solradmin"</arg><!-- Password -->
</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>
</component>
<component name="solrServer1" class="org.apache.solr.client.solrj.impl.HttpSolrServer">

View file

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