You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2023/11/14 11:52:22 UTC

(logging-log4j-samples) 19/34: Add util methods for tests.

This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch merge-server
in repository https://gitbox.apache.org/repos/asf/logging-log4j-samples.git

commit 26eb86dc21c01d4bc63797ee9fc65762578a355e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Aug 15 17:08:12 2017 -0600

    Add util methods for tests.
---
 .../java/org/apache/logging/log4j/server/SecureTcpSocketServer.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/log4j-server/src/main/java/org/apache/logging/log4j/server/SecureTcpSocketServer.java b/log4j-server/src/main/java/org/apache/logging/log4j/server/SecureTcpSocketServer.java
index 81c9d64..39f2afc 100644
--- a/log4j-server/src/main/java/org/apache/logging/log4j/server/SecureTcpSocketServer.java
+++ b/log4j-server/src/main/java/org/apache/logging/log4j/server/SecureTcpSocketServer.java
@@ -23,12 +23,16 @@ import org.apache.logging.log4j.core.net.ssl.SslConfiguration;
 
 /**
  * Listens for events over a secure socket connection (SSL/TLS).
- * 
+ *
  * @param <T>
  *        The kind of input stream read
  */
 public class SecureTcpSocketServer<T extends InputStream> extends TcpSocketServer<T> {
 
+    public static SecureTcpSocketServer<InputStream> createJsonServer(final int port, final SslConfiguration sslConfiguration) throws IOException {
+        return new SecureTcpSocketServer<>(port, new JsonInputStreamLogEventBridge(), sslConfiguration);
+    }
+
     public SecureTcpSocketServer(final int port, final LogEventBridge<T> logEventInput,
             final SslConfiguration sslConfig) throws IOException {
         super(port, logEventInput, sslConfig.getSslServerSocketFactory().createServerSocket(port));