2727import quickfix .Connector ;
2828import quickfix .ExecutorFactory ;
2929import quickfix .FieldConvertError ;
30+ import quickfix .LogUtil ;
3031import quickfix .Session ;
3132import quickfix .SessionFactory ;
3233import quickfix .SessionID ;
@@ -243,7 +244,7 @@ protected void logoutAllSessions(boolean forceDisconnect) {
243244 try {
244245 session .logout ();
245246 } catch (Throwable e ) {
246- logError (session .getSessionID (), null , "Error during logout" , e );
247+ LogUtil . logThrowable (session .getLog () , "Error during logout" , e );
247248 }
248249 }
249250
@@ -255,7 +256,7 @@ protected void logoutAllSessions(boolean forceDisconnect) {
255256 session .disconnect ("Forcibly disconnecting session" , false );
256257 }
257258 } catch (Throwable e ) {
258- logError (session .getSessionID (), null , "Error during disconnect" , e );
259+ LogUtil . logThrowable (session .getLog () , "Error during disconnect" , e );
259260 }
260261 }
261262 } else {
@@ -295,21 +296,6 @@ protected void waitForLogout() {
295296 }
296297 }
297298
298- protected void logError (SessionID sessionID , IoSession protocolSession , String message , Throwable t ) {
299- log .error (message + getLogSuffix (sessionID , protocolSession ), t );
300- }
301-
302- private String getLogSuffix (SessionID sessionID , IoSession protocolSession ) {
303- String suffix = ":" ;
304- if (sessionID != null ) {
305- suffix += "sessionID=" + sessionID .toString () + ";" ;
306- }
307- if (protocolSession != null ) {
308- suffix += "address=" + protocolSession .getRemoteAddress ();
309- }
310- return suffix ;
311- }
312-
313299 protected void startSessionTimer () {
314300 // Check if a session timer is already running to avoid creating multiple timers
315301 if (checkSessionTimerRunning ()) {
@@ -351,7 +337,7 @@ public void run() {
351337 try {
352338 session .next ();
353339 } catch (IOException e ) {
354- logError (session .getSessionID (), null , "Error in session timer processing" , e );
340+ LogUtil . logThrowable (session .getLog () , "Error in session timer processing" , e );
355341 }
356342 }
357343 } catch (Throwable e ) {
0 commit comments