diff --git a/src/main/java/org/codelibs/fess/helper/SystemHelper.java b/src/main/java/org/codelibs/fess/helper/SystemHelper.java index a1311facf..c512bc919 100644 --- a/src/main/java/org/codelibs/fess/helper/SystemHelper.java +++ b/src/main/java/org/codelibs/fess/helper/SystemHelper.java @@ -491,9 +491,8 @@ public class SystemHelper { public void setLogLevel(final String level) { final Level logLevel = Level.toLevel(level, Level.WARN); System.setProperty(Constants.FESS_LOG_LEVEL, logLevel.toString()); - Configurator.setLevel("org.codelibs.fess", logLevel); - Configurator.setLevel("org.dbflute", logLevel); - Configurator.setLevel("org.lastaflute", logLevel); + stream(ComponentUtil.getFessConfig().getLoggingAppPackages(), ",").of( + stream -> stream.map(String::trim).filter(StringUtil::isNotEmpty).forEach(s -> Configurator.setLevel(s, logLevel))); } public String getLogLevel() { diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java index 11276561f..5784ac6d8 100644 --- a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java +++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java @@ -959,6 +959,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction /** The key of the configuration. e.g. filetype,created,click_count,title,doc_id,url,score,site,filename,host,digest,boost,mimetype,favorite_count,_id,lang,last_modified,content_length,timestamp */ String LOGGING_SEARCH_DOCS_FIELDS = "logging.search.docs.fields"; + /** The key of the configuration. e.g. org.codelibs,org.dbflute,org.lastaflute */ + String LOGGING_APP_PACKAGES = "logging.app.packages"; + /** The key of the configuration. e.g. 4000 */ String FORM_ADMIN_MAX_INPUT_SIZE = "form.admin.max.input.size"; @@ -4320,6 +4323,13 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction */ String getLoggingSearchDocsFields(); + /** + * Get the value for the key 'logging.app.packages'.
+ * The value is, e.g. org.codelibs,org.dbflute,org.lastaflute
+ * @return The value of found property. (NotNull: if not found, exception but basically no way) + */ + String getLoggingAppPackages(); + /** * Get the value for the key 'form.admin.max.input.size'.
* The value is, e.g. 4000
@@ -7734,6 +7744,10 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction return get(FessConfig.LOGGING_SEARCH_DOCS_FIELDS); } + public String getLoggingAppPackages() { + return get(FessConfig.LOGGING_APP_PACKAGES); + } + public String getFormAdminMaxInputSize() { return get(FessConfig.FORM_ADMIN_MAX_INPUT_SIZE); } @@ -9100,6 +9114,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction defaultMap .put(FessConfig.LOGGING_SEARCH_DOCS_FIELDS, "filetype,created,click_count,title,doc_id,url,score,site,filename,host,digest,boost,mimetype,favorite_count,_id,lang,last_modified,content_length,timestamp"); + defaultMap.put(FessConfig.LOGGING_APP_PACKAGES, "org.codelibs,org.dbflute,org.lastaflute"); defaultMap.put(FessConfig.FORM_ADMIN_MAX_INPUT_SIZE, "4000"); defaultMap.put(FessConfig.FORM_ADMIN_LABEL_IN_CONFIG_ENABLED, "false"); defaultMap.put(FessConfig.AUTHENTICATION_ADMIN_USERS, "admin"); diff --git a/src/main/resources/fess_config.properties b/src/main/resources/fess_config.properties index c35d59cc4..62aced901 100644 --- a/src/main/resources/fess_config.properties +++ b/src/main/resources/fess_config.properties @@ -542,6 +542,7 @@ index.backup.log.targets=click_log.ndjson,favorite_log.ndjson,search_log.ndjson, # logging logging.search.docs.enabled=true logging.search.docs.fields=filetype,created,click_count,title,doc_id,url,score,site,filename,host,digest,boost,mimetype,favorite_count,_id,lang,last_modified,content_length,timestamp +logging.app.packages=org.codelibs,org.dbflute,org.lastaflute # ======================================================================================== # Web