From 85273a58c3f99f6ab453016b6e1e5b754f3cb65f Mon Sep 17 00:00:00 2001 From: Wendal Chen Date: Tue, 21 Apr 2020 15:02:25 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E7=BD=91=E5=85=B3=E6=94=B9=E6=88=90l?= =?UTF-8?q?og4j2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nutzcloud/nutzcloud-perca/pom.xml | 29 ++++++++++++++----- .../impl/AbstractUrlRewriteRouterFilter.java | 2 ++ .../src/main/resources/log4j.properties | 1 + .../src/main/resources/log4j2.xml | 20 +++++++++++++ 4 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 nutzcloud/nutzcloud-perca/src/main/resources/log4j2.xml diff --git a/nutzcloud/nutzcloud-perca/pom.xml b/nutzcloud/nutzcloud-perca/pom.xml index f1af2cd1..8438b46b 100644 --- a/nutzcloud/nutzcloud-perca/pom.xml +++ b/nutzcloud/nutzcloud-perca/pom.xml @@ -1,4 +1,5 @@ - 4.0.0 org.nutz.cloud @@ -18,19 +19,31 @@ org.nutz.cloud nutzcloud-loach-client + - org.slf4j - slf4j-log4j12 + org.apache.logging.log4j + log4j-core + 2.13.1 + + + org.apache.logging.log4j + log4j-slf4j-impl + 2.13.1 + + + org.apache.logging.log4j + log4j-1.2-api + 2.13.1 org.nutz nutzboot-starter-jetty - - - org.nutz - nutzboot-starter-nacos-discovery - + + + org.nutz + nutzboot-starter-nacos-discovery + diff --git a/nutzcloud/nutzcloud-perca/src/main/java/org/nutz/cloud/perca/impl/AbstractUrlRewriteRouterFilter.java b/nutzcloud/nutzcloud-perca/src/main/java/org/nutz/cloud/perca/impl/AbstractUrlRewriteRouterFilter.java index 461d38d5..8b522269 100644 --- a/nutzcloud/nutzcloud-perca/src/main/java/org/nutz/cloud/perca/impl/AbstractUrlRewriteRouterFilter.java +++ b/nutzcloud/nutzcloud-perca/src/main/java/org/nutz/cloud/perca/impl/AbstractUrlRewriteRouterFilter.java @@ -119,6 +119,8 @@ public abstract class AbstractUrlRewriteRouterFilter implements RouteFilter { ctx.targetHost = info.host; if (info.port > 0) ctx.targetPort = info.port; + if (log.isDebugEnabled()) + log.debugf("forward reqest %s to %s:%s", ctx.uri, ctx.targetHost, ctx.targetPort); return true; } diff --git a/nutzcloud/nutzcloud-perca/src/main/resources/log4j.properties b/nutzcloud/nutzcloud-perca/src/main/resources/log4j.properties index 9fc798df..c9b93eb3 100644 --- a/nutzcloud/nutzcloud-perca/src/main/resources/log4j.properties +++ b/nutzcloud/nutzcloud-perca/src/main/resources/log4j.properties @@ -1,6 +1,7 @@ log4j.rootLogger=debug,Console log4j.logger.org.eclipse.jetty=info +log4j.loagger.com.alibaba.nacos.client=info log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.layout=org.apache.log4j.PatternLayout diff --git a/nutzcloud/nutzcloud-perca/src/main/resources/log4j2.xml b/nutzcloud/nutzcloud-perca/src/main/resources/log4j2.xml new file mode 100644 index 00000000..d4be79cc --- /dev/null +++ b/nutzcloud/nutzcloud-perca/src/main/resources/log4j2.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file