From 1a7ade59cf43c235824a667be03042d528a635b4 Mon Sep 17 00:00:00 2001 From: Steve Hu Date: Wed, 20 Mar 2024 23:22:06 -0400 Subject: [PATCH] fixes #2183 split logger-config and logger-handler to share with light-aws-lambda (#2184) --- .../router/middleware/TokenHandler.java | 2 +- logger-config/pom.xml | 41 +--------- logger-handler/pom.xml | 76 +++++++++++++++++++ .../logging/handler/LoggerGetHandler.java | 0 .../handler/LoggerGetLogContentsHandler.java | 0 .../logging/handler/LoggerGetNameHandler.java | 0 .../logging/handler/LoggerPostHandler.java | 0 logger-handler/src/main/java/module-info.j | 17 +++++ pom.xml | 6 ++ 9 files changed, 103 insertions(+), 39 deletions(-) create mode 100644 logger-handler/pom.xml rename {logger-config => logger-handler}/src/main/java/com/networknt/logging/handler/LoggerGetHandler.java (100%) rename {logger-config => logger-handler}/src/main/java/com/networknt/logging/handler/LoggerGetLogContentsHandler.java (100%) rename {logger-config => logger-handler}/src/main/java/com/networknt/logging/handler/LoggerGetNameHandler.java (100%) rename {logger-config => logger-handler}/src/main/java/com/networknt/logging/handler/LoggerPostHandler.java (100%) create mode 100644 logger-handler/src/main/java/module-info.j diff --git a/egress-router/src/main/java/com/networknt/router/middleware/TokenHandler.java b/egress-router/src/main/java/com/networknt/router/middleware/TokenHandler.java index 2100e6665d..debd2ebb52 100644 --- a/egress-router/src/main/java/com/networknt/router/middleware/TokenHandler.java +++ b/egress-router/src/main/java/com/networknt/router/middleware/TokenHandler.java @@ -80,7 +80,7 @@ public class TokenHandler implements MiddlewareHandler { static Logger logger = LoggerFactory.getLogger(TokenHandler.class); protected volatile HttpHandler next; // Cached jwt token for this handler on behalf of a client by serviceId as the key - public final static Map cache = new ConcurrentHashMap(); + public final static Map cache = new ConcurrentHashMap(); public TokenHandler() { if(logger.isInfoEnabled()) logger.info("TokenHandler is loaded."); config = TokenConfig.load(); diff --git a/logger-config/pom.xml b/logger-config/pom.xml index bcad016d00..f9cff5f13c 100644 --- a/logger-config/pom.xml +++ b/logger-config/pom.xml @@ -11,45 +11,13 @@ 4.0.0 logger-config jar - This module will provide the information about logging and switch logging level. + This module will provide the configuration about logging and switch logging level. com.networknt config - - com.networknt - utility - - - com.networknt - status - - - com.networknt - security - - - com.networknt - body - - - com.networknt - handler - - - com.networknt - http-string - - - com.networknt - client - - - io.undertow - undertow-core - com.fasterxml.jackson.core jackson-databind @@ -58,15 +26,12 @@ org.slf4j slf4j-api + ch.qos.logback logback-classic + test - - commons-codec - commons-codec - - junit junit diff --git a/logger-handler/pom.xml b/logger-handler/pom.xml new file mode 100644 index 0000000000..b79c15f48c --- /dev/null +++ b/logger-handler/pom.xml @@ -0,0 +1,76 @@ + + + + light-4j + com.networknt + 2.1.33-SNAPSHOT + ../pom.xml + + 4.0.0 + logger-handler + jar + This module that contains handler classes for the logger level manipulation. + + + com.networknt + config + + + com.networknt + utility + + + com.networknt + status + + + com.networknt + body + + + com.networknt + handler + + + com.networknt + http-string + + + com.networknt + client + + + com.networknt + logger-config + + + + io.undertow + undertow-core + + + com.fasterxml.jackson.core + jackson-databind + + + org.slf4j + slf4j-api + + + ch.qos.logback + logback-classic + + + commons-codec + commons-codec + + + + junit + junit + test + + + diff --git a/logger-config/src/main/java/com/networknt/logging/handler/LoggerGetHandler.java b/logger-handler/src/main/java/com/networknt/logging/handler/LoggerGetHandler.java similarity index 100% rename from logger-config/src/main/java/com/networknt/logging/handler/LoggerGetHandler.java rename to logger-handler/src/main/java/com/networknt/logging/handler/LoggerGetHandler.java diff --git a/logger-config/src/main/java/com/networknt/logging/handler/LoggerGetLogContentsHandler.java b/logger-handler/src/main/java/com/networknt/logging/handler/LoggerGetLogContentsHandler.java similarity index 100% rename from logger-config/src/main/java/com/networknt/logging/handler/LoggerGetLogContentsHandler.java rename to logger-handler/src/main/java/com/networknt/logging/handler/LoggerGetLogContentsHandler.java diff --git a/logger-config/src/main/java/com/networknt/logging/handler/LoggerGetNameHandler.java b/logger-handler/src/main/java/com/networknt/logging/handler/LoggerGetNameHandler.java similarity index 100% rename from logger-config/src/main/java/com/networknt/logging/handler/LoggerGetNameHandler.java rename to logger-handler/src/main/java/com/networknt/logging/handler/LoggerGetNameHandler.java diff --git a/logger-config/src/main/java/com/networknt/logging/handler/LoggerPostHandler.java b/logger-handler/src/main/java/com/networknt/logging/handler/LoggerPostHandler.java similarity index 100% rename from logger-config/src/main/java/com/networknt/logging/handler/LoggerPostHandler.java rename to logger-handler/src/main/java/com/networknt/logging/handler/LoggerPostHandler.java diff --git a/logger-handler/src/main/java/module-info.j b/logger-handler/src/main/java/module-info.j new file mode 100644 index 0000000000..f63232eaa6 --- /dev/null +++ b/logger-handler/src/main/java/module-info.j @@ -0,0 +1,17 @@ +module com.networknt.logger.config { + exports com.networknt.logging.handler; + exports com.networknt.logging.model; + + requires com.networknt.config; + requires com.networknt.handler; + requires com.networknt.utility; + requires com.networknt.http.string; + requires com.networknt.body; + requires com.networknt.exception; + + requires undertow.core; + requires xnio.api; + requires org.slf4j; + requires ch.qos.logback.classic; + requires com.fasterxml.jackson.core; +} diff --git a/pom.xml b/pom.xml index 120caac438..87cec3df82 100644 --- a/pom.xml +++ b/pom.xml @@ -170,6 +170,7 @@ encode-decode monad-result logger-config + logger-handler http-entity egress-router ingress-proxy @@ -270,6 +271,11 @@ logger-config ${project.version} + + com.networknt + logger-handler + ${project.version} + com.networknt status