Skip to content

Commit 79868ee

Browse files
committed
Included server & connection ids to "connected" message
1 parent c39539d commit 79868ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/github/shyiko/mysql/binlog/BinaryLogClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ public void connect() throws IOException {
319319
if (connected) {
320320
throw new IllegalStateException("BinaryLogClient is already connected");
321321
}
322+
Long connectionId;
322323
try {
323324
try {
324325
Socket socket = socketFactory != null ? socketFactory.createSocket() : new Socket();
@@ -339,6 +340,7 @@ public void connect() throws IOException {
339340
errorPacket.getSqlState());
340341
}
341342
GreetingPacket greetingPacket = new GreetingPacket(initialHandshakePacket);
343+
connectionId = greetingPacket.getThreadId();
342344
authenticate(greetingPacket.getScramble(), greetingPacket.getServerCollation());
343345
if (binlogFilename == null) {
344346
fetchBinlogFilenameAndPosition();
@@ -362,7 +364,8 @@ public void connect() throws IOException {
362364
}
363365
connected = true;
364366
if (logger.isLoggable(Level.INFO)) {
365-
logger.info("Connected to " + hostname + ":" + port + " at " + binlogFilename + "/" + binlogPosition);
367+
logger.info("Connected to " + hostname + ":" + port + " at " + binlogFilename + "/" + binlogPosition +
368+
" (sid:" + serverId + ", cid:" + connectionId + ")");
366369
}
367370
synchronized (lifecycleListeners) {
368371
for (LifecycleListener lifecycleListener : lifecycleListeners) {

0 commit comments

Comments
 (0)