Source:
<code>public void onWebSocketConnect(final Session frontEndSession) { container = ContainerProvider.getWebSocketContainer(); container.setDefaultMaxTextMessageBufferSize(frontEndSession.getPolicy().getMaxTextMessageBufferSize()); container.setDefaultMaxBinaryMessageBufferSize(frontEndSession.getPolicy().getMaxBinaryMessageBufferSize()); container.setAsyncSendTimeout(frontEndSession.getPolicy().getAsyncWriteTimeout()); container.setDefaultMaxSessionIdleTimeout(frontEndSession.getPolicy().getIdleTimeout()); final ProxyInboundClient backendSocket = new ProxyInboundClient(getMessageCallback()); try { backendSession = container.connectToServer(backendSocket, clientConfig, backend); LOG.onConnectionOpen(backend.toString()); } catch (DeploymentException e) { LOG.connectionFailed(e); throw new RuntimeException(e); } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } remoteLock.lock(); super.onWebSocketConnect(frontEndSession); this.frontendSession = frontEndSession; final RemoteEndpoint remote = frontEndSession.getRemote(); try { if (!messageBuffer.isEmpty()) { <START> LOG.logMessage("Found old buffered messages"); <END> for (String obj:messageBuffer) { LOG.logMessage("Sending old buffered message [From Backend <---]: " + obj); remote.sendString(obj); } messageBuffer.clear(); if (remote.getBatchMode() == BatchMode.ON) { remote.flush(); } } else { LOG.logMessage("Message buffer is empty"); } } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } finally { remoteLock.unlock(); } }</code><technical_language>LOG.logMessage is for logging wesocket messages, for generic logging try a new function. Please update in other places. LOG.logMessage is a bad function name, chosen :(</technical_language>

Target:
public void onWebSocketConnect(final Session frontEndSession) { container = ContainerProvider.getWebSocketContainer(); container.setDefaultMaxTextMessageBufferSize(frontEndSession.getPolicy().getMaxTextMessageBufferSize()); container.setDefaultMaxBinaryMessageBufferSize(frontEndSession.getPolicy().getMaxBinaryMessageBufferSize()); container.setAsyncSendTimeout(frontEndSession.getPolicy().getAsyncWriteTimeout()); container.setDefaultMaxSessionIdleTimeout(frontEndSession.getPolicy().getIdleTimeout()); final ProxyInboundClient backendSocket = new ProxyInboundClient(getMessageCallback()); try { backendSession = container.connectToServer(backendSocket, clientConfig, backend); LOG.onConnectionOpen(backend.toString()); } catch (DeploymentException e) { LOG.connectionFailed(e); throw new RuntimeException(e); } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } remoteLock.lock(); super.onWebSocketConnect(frontEndSession); this.frontendSession = frontEndSession; final RemoteEndpoint remote = frontEndSession.getRemote(); try { if (!messageBuffer.isEmpty()) { LOG.debugLog("Found old buffered messages"); for (String obj:messageBuffer) { LOG.debugLog("Sending old buffered message [From Backend <---]: " + obj); remote.sendString(obj); } messageBuffer.clear(); if (remote.getBatchMode() == BatchMode.ON) { remote.flush(); } } else { LOG.debugLog("Message buffer is empty"); } } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } finally { remoteLock.unlock(); } }