Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions quickfixj-core/src/main/java/quickfix/mina/SessionConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import quickfix.Connector;
import quickfix.ExecutorFactory;
import quickfix.FieldConvertError;
import quickfix.LogUtil;
import quickfix.Session;
import quickfix.SessionFactory;
import quickfix.SessionID;
Expand Down Expand Up @@ -243,7 +244,7 @@ protected void logoutAllSessions(boolean forceDisconnect) {
try {
session.logout();
} catch (Throwable e) {
logError(session.getSessionID(), null, "Error during logout", e);
LogUtil.logThrowable(session.getLog(), "Error during logout", e);
}
}

Expand All @@ -255,7 +256,7 @@ protected void logoutAllSessions(boolean forceDisconnect) {
session.disconnect("Forcibly disconnecting session", false);
}
} catch (Throwable e) {
logError(session.getSessionID(), null, "Error during disconnect", e);
LogUtil.logThrowable(session.getLog(), "Error during disconnect", e);
}
}
} else {
Expand Down Expand Up @@ -295,21 +296,6 @@ protected void waitForLogout() {
}
}

protected void logError(SessionID sessionID, IoSession protocolSession, String message, Throwable t) {
log.error(message + getLogSuffix(sessionID, protocolSession), t);
}

private String getLogSuffix(SessionID sessionID, IoSession protocolSession) {
String suffix = ":";
if (sessionID != null) {
suffix += "sessionID=" + sessionID.toString() + ";";
}
if (protocolSession != null) {
suffix += "address=" + protocolSession.getRemoteAddress();
}
return suffix;
}

protected void startSessionTimer() {
Runnable timerTask = new SessionTimerTask();
if (shortLivedExecutor != null) {
Expand Down Expand Up @@ -347,7 +333,7 @@ public void run() {
try {
session.next();
} catch (IOException e) {
logError(session.getSessionID(), null, "Error in session timer processing", e);
LogUtil.logThrowable(session.getLog(), "Error in session timer processing", e);
}
}
} catch (Throwable e) {
Expand Down