From b865cfa54d0bf356f5db8c5876dac48ebf9f0b28 Mon Sep 17 00:00:00 2001 From: Steve Hu Date: Wed, 1 Nov 2023 12:36:58 -0400 Subject: [PATCH] fixes #323 Add info log and trace log in the OpenApiHandler contructor --- .../src/main/java/com/networknt/openapi/OpenApiHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java b/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java index ee539b0..b9253f1 100644 --- a/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java +++ b/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java @@ -80,6 +80,7 @@ public class OpenApiHandler implements MiddlewareHandler { private volatile HttpHandler next; public OpenApiHandler(OpenApiHandlerConfig cfg) { + if(logger.isInfoEnabled()) logger.info("OpenApiHandler is constructed with cfg."); config = cfg; Map inject = Config.getInstance().getJsonMapConfig(SPEC_INJECT); @@ -108,6 +109,7 @@ public OpenApiHandler(OpenApiHandlerConfig cfg) { throw new RuntimeException("merge specification failed for " + entry.getValue()); } } + if(logger.isTraceEnabled()) logger.trace("multiple specifications loaded."); } else { Map openapi = Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME); handlerConfig = (HandlerConfig) Config.getInstance().getJsonObjectConfig(HANDLER_CONFIG, HandlerConfig.class); @@ -128,6 +130,7 @@ public OpenApiHandler(OpenApiHandlerConfig cfg) { logger.error("merge specification failed"); throw new RuntimeException("merge specification failed"); } + if(logger.isTraceEnabled()) logger.trace("single specification loaded."); } }