Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ public boolean isLogPlayerConnections() {
return advanced.isLogPlayerConnections();
}

public boolean isLogConnectionErrors() {
return advanced.isLogConnectionErrors();
}

public boolean isAcceptTransfers() {
return this.advanced.isAcceptTransfers();
}
Expand Down Expand Up @@ -764,6 +768,8 @@ private static class Advanced {
@Expose
private boolean logPlayerConnections = true;
@Expose
private boolean logConnectionErrors = true;
@Expose
private boolean acceptTransfers = false;
@Expose
private boolean enableReusePort = false;
Expand Down Expand Up @@ -801,6 +807,7 @@ private Advanced(CommentedConfig config) {
this.announceProxyCommands = config.getOrElse("announce-proxy-commands", true);
this.logCommandExecutions = config.getOrElse("log-command-executions", false);
this.logPlayerConnections = config.getOrElse("log-player-connections", true);
this.logConnectionErrors = config.getOrElse("log-connection-errors", true);
this.acceptTransfers = config.getOrElse("accepts-transfers", false);
this.enableReusePort = config.getOrElse("enable-reuse-port", false);
this.commandRateLimit = config.getIntOrElse("command-rate-limit", 25);
Expand Down Expand Up @@ -867,6 +874,10 @@ public boolean isLogPlayerConnections() {
return logPlayerConnections;
}

public boolean isLogConnectionErrors() {
return logConnectionErrors;
}

public boolean isAcceptTransfers() {
return this.acceptTransfers;
}
Expand Down Expand Up @@ -911,6 +922,7 @@ public String toString() {
+ ", announceProxyCommands=" + announceProxyCommands
+ ", logCommandExecutions=" + logCommandExecutions
+ ", logPlayerConnections=" + logPlayerConnections
+ ", logConnectionErrors=" + logConnectionErrors
+ ", acceptTransfers=" + acceptTransfers
+ ", enableReusePort=" + enableReusePort
+ '}';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,10 @@ public void handleConnectionException(RegisteredServer server, Throwable throwab
friendlyError = Component.translatable("velocity.error.connected-server-error",
Component.text(server.getServerInfo().getName()));
} else {
logger.error("{}: unable to connect to server {}", this, server.getServerInfo().getName(),
wrapped);
if(this.server.getConfiguration().isLogConnectionErrors()) {
logger.error("{}: unable to connect to server {}", this, server.getServerInfo().getName(),
wrapped);
}
friendlyError = Component.translatable("velocity.error.connecting-server-error",
Component.text(server.getServerInfo().getName()));
}
Expand Down
3 changes: 3 additions & 0 deletions proxy/src/main/resources/default-velocity.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ log-command-executions = false
# and disconnecting from the proxy.
log-player-connections = true

# Enables logging of errors when players fail to connect to backend servers.
logConnectionErrors = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logConnectionErrors = true
log-connection-errors = true


# Allows players transferred from other hosts via the
# Transfer packet (Minecraft 1.20.5) to be received.
accepts-transfers = false
Expand Down