diff --git a/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index ef53252154..fb7ed6f968 100644 --- a/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -45,21 +45,6 @@ public class DesignerLogHandler { private static final int ERRO_GAP_Y = -40; private static final int SERVER_GAP_Y = -20; - static { - GeneralContext.addEnvChangedListener(new EnvChangedListener() { - @Override - public void envChanged() { - // envchange后需要重新读取webinf里的log4j配置, 重新添加appender - FineLoggerFactory.getLogger().addLogAppender(new LogHandler() { - @Override - public DesignerLogAppender getHandler() { - return new DesignerLogAppender(); - } - }); - } - }); - } - public static DesignerLogHandler getInstance() { return HOLDER.singleton; } diff --git a/designer-realize/src/com/fr/start/module/DesignerActivator.java b/designer-realize/src/com/fr/start/module/DesignerActivator.java index 079dd15002..53838ce3dc 100644 --- a/designer-realize/src/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerActivator.java @@ -51,6 +51,7 @@ import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormElementCaseDesigner; import com.fr.design.mainframe.form.FormReportComponentComposite; +import com.fr.design.mainframe.loghandler.DesignerLogAppender; import com.fr.design.mainframe.loghandler.DesignerLogImpl; import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.module.ChartHyperlinkGroup; @@ -73,6 +74,7 @@ import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; import com.fr.locale.InterMutableKey; import com.fr.log.FineLoggerFactory; +import com.fr.log.LogHandler; import com.fr.module.Activator; import com.fr.module.extension.Prepare; import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; @@ -129,6 +131,16 @@ public class DesignerActivator extends Activator implements Prepare { public void start() { designerModuleStart(); preLoadPane(); + loadLogAppender(); + } + + private static void loadLogAppender() { + FineLoggerFactory.getLogger().addLogAppender(new LogHandler() { + @Override + public DesignerLogAppender getHandler() { + return new DesignerLogAppender(); + } + }); } private static void designerModuleStart() {