Skip to content

Commit

Permalink
fixes #2183 split logger-config and logger-handler to share with ligh…
Browse files Browse the repository at this point in the history
…t-aws-lambda (#2184)
  • Loading branch information
stevehu authored Mar 21, 2024
1 parent afc60ce commit 1a7ade5
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Jwt> cache = new ConcurrentHashMap();
public final static Map<String, Jwt> cache = new ConcurrentHashMap<String, Jwt>();
public TokenHandler() {
if(logger.isInfoEnabled()) logger.info("TokenHandler is loaded.");
config = TokenConfig.load();
Expand Down
41 changes: 3 additions & 38 deletions logger-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>logger-config</artifactId>
<packaging>jar</packaging>
<description>This module will provide the information about logging and switch logging level.</description>
<description>This module will provide the configuration about logging and switch logging level.</description>
<dependencies>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>utility</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>status</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>security</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>body</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>handler</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>http-string</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>client</artifactId>
</dependency>

<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand All @@ -58,15 +26,12 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
76 changes: 76 additions & 0 deletions logger-handler/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>light-4j</artifactId>
<groupId>com.networknt</groupId>
<version>2.1.33-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>logger-handler</artifactId>
<packaging>jar</packaging>
<description>This module that contains handler classes for the logger level manipulation.</description>
<dependencies>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>utility</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>status</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>body</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>handler</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>http-string</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>client</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>logger-config</artifactId>
</dependency>

<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
17 changes: 17 additions & 0 deletions logger-handler/src/main/java/module-info.j
Original file line number Diff line number Diff line change
@@ -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;
}
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
<module>encode-decode</module>
<module>monad-result</module>
<module>logger-config</module>
<module>logger-handler</module>
<module>http-entity</module>
<module>egress-router</module>
<module>ingress-proxy</module>
Expand Down Expand Up @@ -270,6 +271,11 @@
<artifactId>logger-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>logger-handler</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>status</artifactId>
Expand Down

0 comments on commit 1a7ade5

Please sign in to comment.