summaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyConnectionLogger.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyConnectionLogger.java')
-rw-r--r--container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyConnectionLogger.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyConnectionLogger.java b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyConnectionLogger.java
index 6406125dcc3..2ea3863cc5a 100644
--- a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyConnectionLogger.java
+++ b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyConnectionLogger.java
@@ -42,7 +42,6 @@ import java.util.List;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
-import java.util.stream.Collectors;
/**
* Jetty integration for jdisc connection log ({@link ConnectionLog}).
@@ -137,6 +136,9 @@ class JettyConnectionLogger extends AbstractLifeCycle implements Connection.List
if (connection instanceof HttpConnection) {
info.setHttpBytes(connection.getBytesIn(), connection.getBytesOut());
}
+ if (connection.getEndPoint() instanceof SslConnection.DecryptedEndPoint ssl) {
+ info.setSslBytes(ssl.getSslConnection().getBytesIn(), ssl.getSslConnection().getBytesOut());
+ }
if (!endpoint.isOpen()) {
info.setClosedAt(System.currentTimeMillis());
connectionLog.log(info.toLogEntry());
@@ -258,6 +260,8 @@ class JettyConnectionLogger extends AbstractLifeCycle implements Connection.List
private List<String> sslSubjectAlternativeNames;
private String proxyProtocolVersion;
private String httpProtocol;
+ private long sslBytesReceived = 0;
+ private long sslBytesSent = 0;
private ConnectionInfo(UUID uuid, long createdAt, InetSocketAddress localAddress, InetSocketAddress peerAddress) {
this.uuid = uuid;
@@ -330,6 +334,12 @@ class JettyConnectionLogger extends AbstractLifeCycle implements Connection.List
synchronized ConnectionInfo setProxyProtocolVersion(String version) { this.proxyProtocolVersion = version; return this; }
+ synchronized ConnectionInfo setSslBytes(long received, long sent) {
+ this.sslBytesReceived = received;
+ this.sslBytesSent = sent;
+ return this;
+ }
+
synchronized ConnectionLogEntry toLogEntry() {
ConnectionLogEntry.Builder builder = ConnectionLogEntry.builder(uuid, Instant.ofEpochMilli(createdAt));
if (closedAt > 0) {
@@ -400,6 +410,12 @@ class JettyConnectionLogger extends AbstractLifeCycle implements Connection.List
if (proxyProtocolVersion != null) {
builder.withProxyProtocolVersion(proxyProtocolVersion);
}
+ if (sslBytesReceived > 0) {
+ builder.withSslBytesReceived(sslBytesReceived);
+ }
+ if (sslBytesSent > 0) {
+ builder.withSslBytesSent(sslBytesSent);
+ }
return builder.build();
}