diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e5f44d4e44..d8f7265f7d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -22,7 +22,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; -import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.logging.log4j.core.LogEvent; import com.fr.third.org.apache.http.client.config.RequestConfig; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; @@ -33,6 +32,7 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.server.socket.CustomLogEvent; import com.fr.workspace.server.socket.LogEventConverter; import io.socket.client.IO; import io.socket.client.Socket; @@ -151,14 +151,14 @@ public class DesignerSocketIO { if (ArrayUtils.isNotEmpty(objects)) { try { Object obj = SerializerHelper.deserialize((byte[]) objects[0]); - // 兼容下老版本服务器 + // 完全去除log4j1.x LogEvent event; - if (obj instanceof LoggingEvent) { - event = LogEventConverter.convert((LoggingEvent) obj); + if (obj instanceof CustomLogEvent) { + event = LogEventConverter.convert((CustomLogEvent) obj); + DesignerLogger.log(event); } else { - event = (LogEvent) obj; + FineLoggerFactory.getLogger().warn("Unable to display server push logs, because server and designer versions are inconsistent!"); } - DesignerLogger.log(event); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); }