You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2020/03/20 07:55:57 UTC

[servicecomb-java-chassis] 02/04: [SCB-1796] support client outlog: add client transport info

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

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git

commit a2d5908979e4c066b04755d0a390f044c9af2574
Author: heyile <25...@qq.com>
AuthorDate: Wed Mar 11 19:40:30 2020 +0800

    [SCB-1796] support client outlog: add client transport info
---
 .../core/invocation/InvocationStageTrace.java      | 14 ++++++++++++
 foundations/foundation-log/pom.xml                 | 18 +++++++++++++++-
 .../foundation/log/LogBootListener.java            | 17 +++++++++++++++
 .../servicecomb/foundation/log/LogBootstrap.java   | 17 +++++++++++++++
 .../servicecomb/foundation/log/LogConfig.java      | 25 +++++++++++++++++++---
 .../log/client/ClientDefaultInitializer.java       | 17 +++++++++++++++
 .../element/impl/DatetimeConfigurableItem.java     |  7 ++++--
 .../core/element/impl/DurationMillisecondItem.java | 19 ++++++++--------
 .../log/core/element/impl/DurationSecondItem.java  |  2 +-
 .../log/core/element/impl/QueryStringItem.java     |  4 +++-
 .../log/core/element/impl/RequestProtocolItem.java |  3 ---
 .../log/core/element/impl/ResponseSizeItem.java    |  7 ++----
 ...{DurationSecondItem.java => TransportItem.java} | 20 +++++++++++++----
 .../impl/DefaultCompositeVertxRestLogItemMeta.java |  2 ++
 .../log/server/ServerDefaultInitializer.java       | 17 +++++++++++++++
 ...rtx.accesslog.parser.VertxRestAccessLogItemMeta | 18 ----------------
 ...rtx.accesslog.parser.VertxRestAccessLogItemMeta | 19 ----------------
 17 files changed, 159 insertions(+), 67 deletions(-)

diff --git a/core/src/main/java/org/apache/servicecomb/core/invocation/InvocationStageTrace.java b/core/src/main/java/org/apache/servicecomb/core/invocation/InvocationStageTrace.java
index 27296b2..b5a81f1 100644
--- a/core/src/main/java/org/apache/servicecomb/core/invocation/InvocationStageTrace.java
+++ b/core/src/main/java/org/apache/servicecomb/core/invocation/InvocationStageTrace.java
@@ -87,6 +87,9 @@ public class InvocationStageTrace {
 
   private Invocation invocation;
 
+  // current time for start invocation
+  private long startCurrentTime;
+
   private long start;
 
   private long startHandlersRequest;
@@ -135,6 +138,8 @@ public class InvocationStageTrace {
   }
 
   public void start(long start) {
+    // remember the current time to start invocation
+    this.startCurrentTime = System.currentTimeMillis();
     this.start = start;
   }
 
@@ -142,6 +147,15 @@ public class InvocationStageTrace {
     return start;
   }
 
+  public long getStartCurrentTime() {
+    return startCurrentTime;
+  }
+
+  public InvocationStageTrace setStartCurrentTime(long startCurrentTime) {
+    this.startCurrentTime = startCurrentTime;
+    return this;
+  }
+
   public long getStartHandlersRequest() {
     return startHandlersRequest;
   }
diff --git a/foundations/foundation-log/pom.xml b/foundations/foundation-log/pom.xml
index 83cbe24..4d229a9 100644
--- a/foundations/foundation-log/pom.xml
+++ b/foundations/foundation-log/pom.xml
@@ -1,4 +1,20 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
 <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">
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootListener.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootListener.java
index 250aa5f..2be8cb2 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootListener.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootListener.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.servicecomb.foundation.log;
 
 import org.apache.servicecomb.core.BootListener;
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootstrap.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootstrap.java
index 286289f..f8493f4 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootstrap.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogBootstrap.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.servicecomb.foundation.log;
 
 import org.apache.servicecomb.foundation.common.utils.SPIServiceUtils;
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogConfig.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogConfig.java
index 4496aeb..8b4de90 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogConfig.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/LogConfig.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.servicecomb.foundation.log;
 
 import com.netflix.config.DynamicPropertyFactory;
@@ -16,7 +33,9 @@ public class LogConfig {
 
     private static final String CLIENT_LOG_PATTERN = CLIENT_BASE + "pattern";
 
-    public static final String DEFAULT_PATTERN = "%h - - %t %r %s %B %D";
+    private static final String DEFAULT_SERVER_PATTERN = "%h - - %t %r %s %B %D";
+
+    private static final String DEFAULT_CLIENT_PATTERN = "%h %SCB-transport - - %t %r %s %D";
 
     public static final LogConfig INSTANCE = new LogConfig();
 
@@ -38,9 +57,9 @@ public class LogConfig {
         serverLogEnabled = DynamicPropertyFactory
             .getInstance().getBooleanProperty(SERVER_LOG_ENABLED, false).get();
         clientLogPattern = DynamicPropertyFactory
-          .getInstance().getStringProperty(CLIENT_LOG_PATTERN, DEFAULT_PATTERN).get();
+          .getInstance().getStringProperty(CLIENT_LOG_PATTERN, DEFAULT_CLIENT_PATTERN).get();
         serverLogPattern = DynamicPropertyFactory
-            .getInstance().getStringProperty(SERVER_LOG_PATTERN, DEFAULT_PATTERN).get();
+            .getInstance().getStringProperty(SERVER_LOG_PATTERN, DEFAULT_SERVER_PATTERN).get();
     }
 
     public boolean isServerLogEnabled() {
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/client/ClientDefaultInitializer.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/client/ClientDefaultInitializer.java
index 7ba14d2..2820cc2 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/client/ClientDefaultInitializer.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/client/ClientDefaultInitializer.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.servicecomb.foundation.log.client;
 
 import org.apache.servicecomb.core.event.InvocationFinishEvent;
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DatetimeConfigurableItem.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DatetimeConfigurableItem.java
index 98657bf..4ef94f7 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DatetimeConfigurableItem.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DatetimeConfigurableItem.java
@@ -68,7 +68,7 @@ public class DatetimeConfigurableItem implements LogItem<RoutingContext> {
     }
     if (3 != configArr.length) {
       throw new IllegalArgumentException(
-        "wrong format of configuration, \"PATTERN|TIMEZONE|LOCALE\" is expected, but actually is \"" + config + "\"");
+          "wrong format of configuration, \"PATTERN|TIMEZONE|LOCALE\" is expected, but actually is \"" + config + "\"");
     }
 
     setConfigruations(configArr);
@@ -91,7 +91,10 @@ public class DatetimeConfigurableItem implements LogItem<RoutingContext> {
 
   @Override
   public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
-    doAppendFormattedItem(finishEvent.getInvocation().getInvocationStageTrace().getStart() / 1000_000, builder);
+    long milliDuration = (finishEvent.getInvocation().getInvocationStageTrace().getStartSend() -
+        finishEvent.getInvocation().getInvocationStageTrace().getStart()) / 1000_000;
+    doAppendFormattedItem(
+        finishEvent.getInvocation().getInvocationStageTrace().getStartCurrentTime() + milliDuration, builder);
   }
 
   private void doAppendFormattedItem(long milliStartTime, StringBuilder builder) {
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationMillisecondItem.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationMillisecondItem.java
index 10b7b71..c272208 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationMillisecondItem.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationMillisecondItem.java
@@ -24,15 +24,14 @@ import org.apache.servicecomb.foundation.log.core.element.LogItem;
 import io.vertx.ext.web.RoutingContext;
 
 public class DurationMillisecondItem implements LogItem<RoutingContext> {
+  @Override
+  public void appendFormattedItem(ServerAccessLogEvent accessLogEvent, StringBuilder builder) {
+    builder.append(accessLogEvent.getMilliEndTime() - accessLogEvent.getMilliStartTime());
+  }
 
-    @Override
-    public void appendFormattedItem(ServerAccessLogEvent accessLogEvent, StringBuilder builder) {
-        builder.append(accessLogEvent.getMilliEndTime() - accessLogEvent.getMilliStartTime());
-    }
-
-    @Override
-    public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
-        builder.append((finishEvent.getInvocation().getInvocationStageTrace().getFinish() -
-          finishEvent.getInvocation().getInvocationStageTrace().getStart()) / 1000_000);
-    }
+  @Override
+  public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
+    builder.append((finishEvent.getInvocation().getInvocationStageTrace().getFinish() -
+        finishEvent.getInvocation().getInvocationStageTrace().getStartSend()) / 1000_000);
+  }
 }
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationSecondItem.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationSecondItem.java
index 8517685..c468703 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationSecondItem.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationSecondItem.java
@@ -34,6 +34,6 @@ public class DurationSecondItem implements LogItem<RoutingContext> {
   @Override
   public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
     builder.append((finishEvent.getInvocation().getInvocationStageTrace().getFinish() -
-      finishEvent.getInvocation().getInvocationStageTrace().getStart()) / 1000_000_000);
+      finishEvent.getInvocation().getInvocationStageTrace().getStartSend()) / 1000_000_000);
   }
 }
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/QueryStringItem.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/QueryStringItem.java
index 157bd39..efb35dd 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/QueryStringItem.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/QueryStringItem.java
@@ -17,6 +17,7 @@
 
 package org.apache.servicecomb.foundation.log.core.element.impl;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.servicecomb.common.rest.RestConst;
 import org.apache.servicecomb.common.rest.codec.param.RestClientRequestImpl;
 import org.apache.servicecomb.core.event.InvocationFinishEvent;
@@ -44,7 +45,8 @@ public class QueryStringItem implements LogItem<RoutingContext> {
   public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
     RestClientRequestImpl restRequestImpl = (RestClientRequestImpl) finishEvent.getInvocation().getHandlerContext()
       .get(RestConst.INVOCATION_HANDLER_REQUESTCLIENT);
-    if (null == restRequestImpl || null == restRequestImpl.getRequest()) {
+    if (null == restRequestImpl || null == restRequestImpl.getRequest()
+        || StringUtils.isEmpty(restRequestImpl.getRequest().query())) {
       builder.append(EMPTY_RESULT);
       return;
     }
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/RequestProtocolItem.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/RequestProtocolItem.java
index 8c9a339..f0ecd8e 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/RequestProtocolItem.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/RequestProtocolItem.java
@@ -42,9 +42,6 @@ public class RequestProtocolItem implements LogItem<RoutingContext> {
     builder.append(getStringVersion(request.version()));
   }
 
-  /**
-   * 先这样实现, 后面讨论
-   */
   @Override
   public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
     Endpoint endpoint = finishEvent.getInvocation().getEndpoint();
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/ResponseSizeItem.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/ResponseSizeItem.java
index a982990..c9bff18 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/ResponseSizeItem.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/ResponseSizeItem.java
@@ -44,11 +44,8 @@ public class ResponseSizeItem implements LogItem<RoutingContext> {
 
   @Override
   public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
-    if (null == finishEvent.getResponse().getResult()) {
-      builder.append(zeroBytes);
-      return;
-    }
-    builder.append(finishEvent.getResponse().getResult().toString().length());
+    //client do not know how to calculate is write..
+    builder.append(zeroBytes);
   }
 
   public String getZeroBytes() {
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationSecondItem.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/TransportItem.java
similarity index 66%
copy from foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationSecondItem.java
copy to foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/TransportItem.java
index 8517685..a72d231 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/DurationSecondItem.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/element/impl/TransportItem.java
@@ -18,22 +18,34 @@
 package org.apache.servicecomb.foundation.log.core.element.impl;
 
 
+import org.apache.commons.lang3.StringUtils;
+import org.apache.servicecomb.core.Endpoint;
 import org.apache.servicecomb.core.event.InvocationFinishEvent;
 import org.apache.servicecomb.core.event.ServerAccessLogEvent;
 import org.apache.servicecomb.foundation.log.core.element.LogItem;
 
 import io.vertx.ext.web.RoutingContext;
 
-public class DurationSecondItem implements LogItem<RoutingContext> {
+public class TransportItem implements LogItem<RoutingContext> {
+  private static final String EMPTY_STR = "-";
 
   @Override
   public void appendFormattedItem(ServerAccessLogEvent accessLogEvent, StringBuilder builder) {
-    builder.append((accessLogEvent.getMilliEndTime() - accessLogEvent.getMilliStartTime()) / 1000);
+    builder.append(EMPTY_STR);
   }
 
   @Override
   public void appendFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
-    builder.append((finishEvent.getInvocation().getInvocationStageTrace().getFinish() -
-      finishEvent.getInvocation().getInvocationStageTrace().getStart()) / 1000_000_000);
+    String transportName = finishEvent.getInvocation().getConfigTransportName();
+    if (!StringUtils.isEmpty(transportName)) {
+      builder.append(transportName);
+      return;
+    }
+    Endpoint endpoint = finishEvent.getInvocation().getEndpoint();
+    if (endpoint == null || StringUtils.isEmpty(endpoint.getEndpoint())) {
+      builder.append(EMPTY_STR);
+      return;
+    }
+    builder.append(endpoint.getEndpoint().split(":")[0]);
   }
 }
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/parser/impl/DefaultCompositeVertxRestLogItemMeta.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/parser/impl/DefaultCompositeVertxRestLogItemMeta.java
index 7b5cd4a..b410d61 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/parser/impl/DefaultCompositeVertxRestLogItemMeta.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/core/parser/impl/DefaultCompositeVertxRestLogItemMeta.java
@@ -28,6 +28,7 @@ import org.apache.servicecomb.foundation.log.core.element.impl.DurationSecondIte
 import org.apache.servicecomb.foundation.log.core.element.impl.FirstLineOfRequestItem;
 import org.apache.servicecomb.foundation.log.core.element.impl.HttpMethodItem;
 import org.apache.servicecomb.foundation.log.core.element.impl.HttpStatusItem;
+import org.apache.servicecomb.foundation.log.core.element.impl.TransportItem;
 import org.apache.servicecomb.foundation.log.core.element.impl.InvocationContextItem;
 import org.apache.servicecomb.foundation.log.core.element.impl.LocalHostItem;
 import org.apache.servicecomb.foundation.log.core.element.impl.LocalPortItem;
@@ -72,6 +73,7 @@ public class DefaultCompositeVertxRestLogItemMeta extends CompositeVertxRestLogI
     SUPPORTED_META.add(new VertxRestLogItemMeta("%H", config -> new RequestProtocolItem()));
     SUPPORTED_META.add(new VertxRestLogItemMeta("%t", config -> new DatetimeConfigurableItem()));
     SUPPORTED_META.add(new VertxRestLogItemMeta("%SCB-traceId", config -> new TraceIdItem()));
+    SUPPORTED_META.add(new VertxRestLogItemMeta("%SCB-transport", config -> new TransportItem()));
 
     SUPPORTED_META.add(new VertxRestLogItemMeta("%{", "}t", DatetimeConfigurableItem::new));
     SUPPORTED_META.add(new VertxRestLogItemMeta("%{", "}i", RequestHeaderItem::new));
diff --git a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/server/ServerDefaultInitializer.java b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/server/ServerDefaultInitializer.java
index e9ca5ea..aec21bb 100644
--- a/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/server/ServerDefaultInitializer.java
+++ b/foundations/foundation-log/src/main/java/org/apache/servicecomb/foundation/log/server/ServerDefaultInitializer.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.servicecomb.foundation.log.server;
 
 import org.apache.servicecomb.core.event.ServerAccessLogEvent;
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/resources/META-INF/services/org.apache.servicecomb.transport.rest.vertx.accesslog.parser.VertxRestAccessLogItemMeta b/transports/transport-rest/transport-rest-vertx/src/main/resources/META-INF/services/org.apache.servicecomb.transport.rest.vertx.accesslog.parser.VertxRestAccessLogItemMeta
deleted file mode 100644
index 7a9f86c..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/resources/META-INF/services/org.apache.servicecomb.transport.rest.vertx.accesslog.parser.VertxRestAccessLogItemMeta
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.servicecomb.transport.rest.vertx.accesslog.parser.impl.DefaultCompositeVertxRestAccessLogItemMeta
\ No newline at end of file
diff --git a/transports/transport-rest/transport-rest-vertx/src/test/resources/META-INF/services/org.apache.servicecomb.transport.rest.vertx.accesslog.parser.VertxRestAccessLogItemMeta b/transports/transport-rest/transport-rest-vertx/src/test/resources/META-INF/services/org.apache.servicecomb.transport.rest.vertx.accesslog.parser.VertxRestAccessLogItemMeta
deleted file mode 100644
index b539f7c..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/test/resources/META-INF/services/org.apache.servicecomb.transport.rest.vertx.accesslog.parser.VertxRestAccessLogItemMeta
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.servicecomb.transport.rest.vertx.accesslog.parser.impl.TestSingleExtendedAccessLogItemMeta
-org.apache.servicecomb.transport.rest.vertx.accesslog.parser.impl.TestCompositeExtendedAccessLogItemMeta
\ No newline at end of file