diff --git a/src/main/java/jp/sf/fess/log/MobyletLoggerImpl.java b/src/main/java/jp/sf/fess/log/MobyletLoggerImpl.java new file mode 100644 index 000000000..382c62d03 --- /dev/null +++ b/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); + } + } + +} diff --git a/src/main/mysql/webapp/WEB-INF/web.xml b/src/main/mysql/webapp/WEB-INF/web.xml index 784504f2e..8f8e831e7 100644 --- a/src/main/mysql/webapp/WEB-INF/web.xml +++ b/src/main/mysql/webapp/WEB-INF/web.xml @@ -42,6 +42,10 @@ encoding UTF-8 + + mobylet.logger.class + jp.sf.fess.log.MobyletLoggerImpl + diff --git a/src/main/oracle/webapp/WEB-INF/web.xml b/src/main/oracle/webapp/WEB-INF/web.xml index 784504f2e..8f8e831e7 100644 --- a/src/main/oracle/webapp/WEB-INF/web.xml +++ b/src/main/oracle/webapp/WEB-INF/web.xml @@ -42,6 +42,10 @@ encoding UTF-8 + + mobylet.logger.class + jp.sf.fess.log.MobyletLoggerImpl + diff --git a/src/main/resources/fess_suggest.dicon b/src/main/resources/fess_suggest.dicon index 62f2af578..c0ce49681 100644 --- a/src/main/resources/fess_suggest.dicon +++ b/src/main/resources/fess_suggest.dicon @@ -114,13 +114,14 @@ - + "solradmin" "solradmin" - + clientConnectionManager diff --git a/src/main/resources/solrlib.dicon b/src/main/resources/solrlib.dicon index 2598238a8..dcd50ed0f 100644 --- a/src/main/resources/solrlib.dicon +++ b/src/main/resources/solrlib.dicon @@ -92,13 +92,14 @@ - + "solradmin" "solradmin" - + clientConnectionManager diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 409c5a754..437190918 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -42,6 +42,10 @@ encoding UTF-8 + + mobylet.logger.class + jp.sf.fess.log.MobyletLoggerImpl +