Browse Source

Pull request #7882: REPORT-66521 完全移除log4j1.x依赖

Merge in DESIGN/design from ~HADES/design:release/11.0 to release/11.0

* commit '93d206b987e3acb6f950a6650fe400a743e5bf1d':
  REPORT-66521 完全移除log4j1.x依赖
bugfix/11.0
Hades 3 years ago
parent
commit
a3e40865f8
  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.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);
}

Loading…
Cancel
Save