Browse Source

REPORT-66521 完全移除log4j1.x依赖

bugfix/11.0
hades 3 years ago
parent
commit
93d206b987
  1. 12
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

12
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.serialization.SerializerHelper;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils; 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.apache.logging.log4j.core.LogEvent;
import com.fr.third.org.apache.http.client.config.RequestConfig; import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; 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.Workspace;
import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.server.socket.CustomLogEvent;
import com.fr.workspace.server.socket.LogEventConverter; import com.fr.workspace.server.socket.LogEventConverter;
import io.socket.client.IO; import io.socket.client.IO;
import io.socket.client.Socket; import io.socket.client.Socket;
@ -151,14 +151,14 @@ public class DesignerSocketIO {
if (ArrayUtils.isNotEmpty(objects)) { if (ArrayUtils.isNotEmpty(objects)) {
try { try {
Object obj = SerializerHelper.deserialize((byte[]) objects[0]); Object obj = SerializerHelper.deserialize((byte[]) objects[0]);
// 兼容下老版本服务器 // 完全去除log4j1.x
LogEvent event; LogEvent event;
if (obj instanceof LoggingEvent) { if (obj instanceof CustomLogEvent) {
event = LogEventConverter.convert((LoggingEvent) obj); event = LogEventConverter.convert((CustomLogEvent) obj);
DesignerLogger.log(event);
} else { } 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) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }

Loading…
Cancel
Save