fix #1895 change log level
This commit is contained in:
parent
189532f9dc
commit
ebdbb7b768
9 changed files with 53 additions and 0 deletions
|
@ -427,4 +427,6 @@ public class Constants extends CoreLibConstants {
|
|||
public static final String FESS_THUMBNAIL_PATH = "fess.thumbnail.path";
|
||||
|
||||
public static final String FESS_VAR_PATH = "fess.var.path";
|
||||
|
||||
public static final String FESS_LOG_LEVEL = "fess.log.level";
|
||||
}
|
||||
|
|
|
@ -168,6 +168,10 @@ public class AdminGeneralAction extends FessAdminAction {
|
|||
fessConfig.storeSystemProperties();
|
||||
ComponentUtil.getLdapManager().updateConfig();
|
||||
ComponentUtil.getSystemHelper().refreshDesignJspFiles();
|
||||
|
||||
if (StringUtil.isNotBlank(form.logLevel)) {
|
||||
ComponentUtil.getSystemHelper().setLogLevel(form.logLevel);
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateForm(final FessConfig fessConfig, final EditForm form) {
|
||||
|
@ -209,6 +213,7 @@ public class AdminGeneralAction extends FessAdminAction {
|
|||
form.ldapMemberofAttribute = fessConfig.getLdapMemberofAttribute();
|
||||
form.notificationLogin = fessConfig.getNotificationLogin();
|
||||
form.notificationSearchTop = fessConfig.getNotificationSearchTop();
|
||||
form.logLevel = ComponentUtil.getSystemHelper().getLogLevel().toUpperCase();
|
||||
}
|
||||
|
||||
private void updateProperty(final String key, final String value) {
|
||||
|
|
|
@ -156,4 +156,7 @@ public class EditForm {
|
|||
|
||||
@Size(max = 3000)
|
||||
public String notificationSearchTop;
|
||||
|
||||
@Size(max = 10)
|
||||
public String logLevel;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,8 @@ import javax.servlet.ServletContext;
|
|||
|
||||
import org.apache.commons.lang3.LocaleUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.core.config.Configurator;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.core.misc.Pair;
|
||||
import org.codelibs.fess.Constants;
|
||||
|
@ -455,6 +457,18 @@ public class SystemHelper {
|
|||
return response;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public String getLogLevel() {
|
||||
return System.getProperty(Constants.FESS_LOG_LEVEL, Level.WARN.toString());
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
|
|
@ -242,6 +242,9 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Purge By Bots */
|
||||
public static final String LABELS_PURGE_BY_BOTS = "{labels.purgeByBots}";
|
||||
|
||||
/** The key of the message: Log Level */
|
||||
public static final String LABELS_LOG_LEVEL = "{labels.logLevel}";
|
||||
|
||||
/** The key of the message: Purge Search Log */
|
||||
public static final String LABELS_PURGE_SEARCH_LOG_DAY = "{labels.purgeSearchLogDay}";
|
||||
|
||||
|
@ -1208,6 +1211,9 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Bots Name For Purge */
|
||||
public static final String LABELS_purge_by_bots = "{labels.purge_by_bots}";
|
||||
|
||||
/** The key of the message: Log Level */
|
||||
public static final String LABELS_log_level = "{labels.log_level}";
|
||||
|
||||
/** The key of the message: Encoding for CSV */
|
||||
public static final String LABELS_csv_file_encoding = "{labels.csv_file_encoding}";
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ labels.num=Num
|
|||
labels.pn=Page Number
|
||||
labels.protocolScheme=Scheme
|
||||
labels.purgeByBots=Purge By Bots
|
||||
labels.logLevel=Log Level
|
||||
labels.purgeSearchLogDay=Purge Search Log
|
||||
labels.query=Query
|
||||
labels.queryId=Query ID
|
||||
|
@ -394,6 +395,7 @@ labels.purge_search_log_day=Purge Search Log Before
|
|||
labels.purge_job_log_day=Purge Job Log Before
|
||||
labels.purge_user_info_day=Purge User Before
|
||||
labels.purge_by_bots=Bots Name For Purge
|
||||
labels.log_level=Log Level
|
||||
labels.csv_file_encoding=Encoding for CSV
|
||||
labels.notification_to=Notification Email
|
||||
labels.pathmap_configuration=Path Mapping
|
||||
|
|
|
@ -70,6 +70,7 @@ labels.num=Num
|
|||
labels.pn=Page Number
|
||||
labels.protocolScheme=Scheme
|
||||
labels.purgeByBots=Purge By Bots
|
||||
labels.logLevel=Log Level
|
||||
labels.purgeSearchLogDay=Purge Search Log
|
||||
labels.query=Query
|
||||
labels.queryId=Query ID
|
||||
|
@ -394,6 +395,7 @@ labels.purge_search_log_day=Purge Search Log Before
|
|||
labels.purge_job_log_day=Purge Job Log Before
|
||||
labels.purge_user_info_day=Purge User Before
|
||||
labels.purge_by_bots=Bots Name For Purge
|
||||
labels.log_level=Log Level
|
||||
labels.csv_file_encoding=Encoding for CSV
|
||||
labels.notification_to=Notification Email
|
||||
labels.pathmap_configuration=Path Mapping
|
||||
|
|
|
@ -70,6 +70,7 @@ labels.num=数
|
|||
labels.pn=ページ番号
|
||||
labels.protocolScheme=スキーム
|
||||
labels.purgeByBots=Botsの削除
|
||||
labels.logLevel=ログレベル
|
||||
labels.purgeSearchLogDay=検索ログの削除
|
||||
labels.query=クエリー
|
||||
labels.queryId=クエリーID
|
||||
|
@ -386,6 +387,7 @@ labels.purge_search_log_day=以前の検索ログを削除
|
|||
labels.purge_job_log_day=以前のジョブログを削除
|
||||
labels.purge_user_info_day=以前のユーザーログを削除
|
||||
labels.purge_by_bots=ログを削除するボット名
|
||||
labels.log_level=ログレベル
|
||||
labels.csv_file_encoding=CSVファイルのエンコード
|
||||
labels.notification_to=通知メール
|
||||
labels.pathmap_configuration=パスマッピング
|
||||
|
|
|
@ -303,6 +303,23 @@
|
|||
<la:text styleId="purgeByBots" property="purgeByBots" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="logLevel" class="col-sm-3 control-label"><la:message
|
||||
key="labels.log_level" /></label>
|
||||
<div class="form-inline col-sm-9">
|
||||
<la:errors property="logLevel" />
|
||||
<la:select styleId="logLevel" property="logLevel" styleClass="form-control">
|
||||
<la:option value="OFF">OFF</la:option>
|
||||
<la:option value="FATAL">FATAL</la:option>
|
||||
<la:option value="ERROR">ERROR</la:option>
|
||||
<la:option value="WARN">WARN</la:option>
|
||||
<la:option value="INFO">INFO</la:option>
|
||||
<la:option value="DEBUG">DEBUG</la:option>
|
||||
<la:option value="TRACE">TRACE</la:option>
|
||||
<la:option value="ALL">ALL</la:option>
|
||||
</la:select>
|
||||
</div>
|
||||
</div>
|
||||
<%-- Suggest --%>
|
||||
<h4><la:message key="labels.general_menu_suggest" /></h4>
|
||||
<div class="form-group">
|
||||
|
|
Loading…
Add table
Reference in a new issue