Skip to content

Commit 3b60f3f

Browse files
committed
server logging cleanup
1 parent 4f9831d commit 3b60f3f

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

endermux-server/src/main/java/xyz/jpenilla/endermux/server/EndermuxServer.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void start() {
101101
this.acceptorThread.start();
102102
this.publishSocketPath(this.socketStartupPath);
103103

104-
LOGGER.info("Listening for console socket connections at: {}", this.socketPath);
104+
LOGGER.info("Console socket server listening at {}", this.socketPath);
105105
} catch (final IOException e) {
106106
LOGGER.error("Failed to start console socket server", e);
107107
this.running.set(false);
@@ -112,7 +112,7 @@ public void start() {
112112

113113
public void stop() {
114114
if (this.running.compareAndSet(true, false)) {
115-
LOGGER.info("Stopping console socket server...");
115+
LOGGER.info("Stopping console socket server");
116116
this.closeServerChannel();
117117
this.closeConnections();
118118
this.shutdownExecutor();
@@ -128,7 +128,7 @@ private void acceptConnections() {
128128
final SocketChannel clientChannel = this.serverChannel.accept();
129129
if (clientChannel != null) {
130130
if (this.connections.size() >= this.maxConnections) {
131-
LOGGER.warn("Maximum socket connections ({}) reached, rejecting new connection", this.maxConnections);
131+
LOGGER.warn("Rejected console socket connection: maximum connections ({}) reached", this.maxConnections);
132132
clientChannel.close();
133133
continue;
134134
}
@@ -137,7 +137,7 @@ private void acceptConnections() {
137137
}
138138
} catch (final IOException e) {
139139
if (this.running.get()) {
140-
LOGGER.error("Error accepting socket connection", e);
140+
LOGGER.error("Failed to accept console socket connection", e);
141141
}
142142
}
143143
}
@@ -152,7 +152,7 @@ private void handleNewConnection(final SocketChannel clientChannel) {
152152
this.executor.submit(() -> this.runConnection(connection, session));
153153

154154
} catch (final IOException e) {
155-
LOGGER.error("Failed to setup client connection", e);
155+
LOGGER.error("Failed to set up console socket connection", e);
156156
try {
157157
clientChannel.close();
158158
} catch (final IOException ignored) {
@@ -168,13 +168,13 @@ private void runConnection(final ClientEndpoint connection, final ClientSession
168168
}
169169

170170
this.connections.add(connection);
171-
LOGGER.info("New console socket connection established ({} total connections)", this.connections.size());
171+
LOGGER.info("Console socket connection established ({} active)", this.connections.size());
172172

173173
session.initialize();
174174

175175
connection.run();
176176
} catch (final IOException e) {
177-
LOGGER.debug("Connection setup failed", e);
177+
LOGGER.debug("Console socket connection setup failed", e);
178178
connection.close();
179179
}
180180
}
@@ -291,7 +291,7 @@ private void publishSocketPath(final Path startupSocketPath) throws IOException
291291
void removeConnection(final ClientEndpoint connection) {
292292
this.sessions.remove(connection);
293293
if (this.connections.remove(connection)) {
294-
LOGGER.info("Console socket connection closed ({} total connections)", this.connections.size());
294+
LOGGER.info("Console socket connection closed ({} active)", this.connections.size());
295295
}
296296
}
297297

endermux-server/src/main/java/xyz/jpenilla/endermux/server/FramedSocketEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void close() {
8585
this.reader.close();
8686
this.socketChannel.close();
8787
} catch (final IOException e) {
88-
LOGGER.debug("Error closing socket connection", e);
88+
LOGGER.debug("Failed to close console socket connection", e);
8989
} finally {
9090
this.state.set(ConnectionState.DISCONNECTED);
9191
}

0 commit comments

Comments
 (0)