You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by wu...@apache.org on 2018/06/05 07:29:43 UTC

[incubator-servicecomb-java-chassis] 01/06: [SCB-616] remove old access log parse logic

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

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

commit 7b768e2ad599e41dc8b6dffb1bc3897e52449246
Author: yaohaishi <ya...@huawei.com>
AuthorDate: Mon May 28 17:36:02 2018 +0800

    [SCB-616] remove old access log parse logic
---
 .../transport/rest/vertx/RestServerVerticle.java   |   7 +-
 .../rest/vertx/accesslog/AccessLogGenerator.java   |  16 +--
 .../accesslog/element/AccessLogItemFactory.java    |  67 -----------
 .../element/creator/AccessLogItemCreator.java      |  28 -----
 .../PercentagePrefixConfigurableItemCreator.java   |  68 -----------
 .../creator/SimpleAccessLogItemCreator.java        |  76 -------------
 .../vertx/accesslog/impl/AccessLogHandler.java     |   5 +-
 .../accesslog/parser/AccessLogItemLocation.java    |  86 --------------
 .../accesslog/parser/AccessLogPatternParser.java   |  27 -----
 .../parser/impl/DefaultAccessLogPatternParser.java | 125 ---------------------
 .../parser/matcher/AccessLogItemMatcher.java       |  28 -----
 .../PercentagePrefixConfigurableMatcher.java       |  84 --------------
 .../parser/matcher/SimpleItemMatcher.java          |  78 -------------
 .../vertx/accesslog/AccessLogGeneratorTest.java    |  14 +--
 .../element/AccessLogItemFactoryTest.java          |  56 ---------
 ...ercentagePrefixConfigurableItemCreatorTest.java | 106 -----------------
 .../impl/DefaultAccessLogPatternParserTest.java    | 119 --------------------
 .../PercentagePrefixConfigurableMatcherTest.java   |  73 ------------
 .../parser/matcher/SimpleItemMatcherTest.java      |  58 ----------
 19 files changed, 8 insertions(+), 1113 deletions(-)

diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java
index 2075d15..f2ac2fb 100644
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java
+++ b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java
@@ -29,7 +29,6 @@ import org.apache.servicecomb.foundation.ssl.SSLOptionFactory;
 import org.apache.servicecomb.foundation.vertx.VertxTLSBuilder;
 import org.apache.servicecomb.transport.rest.vertx.accesslog.AccessLogConfiguration;
 import org.apache.servicecomb.transport.rest.vertx.accesslog.impl.AccessLogHandler;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.impl.DefaultAccessLogPatternParser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -86,15 +85,15 @@ public class RestServerVerticle extends AbstractVerticle {
       LOGGER.info("access log enabled, pattern = {}", pattern);
       mainRouter.route()
           .handler(new AccessLogHandler(
-              pattern,
-              new DefaultAccessLogPatternParser()));
+              pattern
+          ));
     }
   }
 
   private void initDispatcher(Router mainRouter) {
     List<VertxHttpDispatcher> dispatchers = SPIServiceUtils.getSortedService(VertxHttpDispatcher.class);
     for (VertxHttpDispatcher dispatcher : dispatchers) {
-      if(dispatcher.enabled()) {
+      if (dispatcher.enabled()) {
         dispatcher.init(mainRouter);
       }
     }
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGenerator.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGenerator.java
index c44491e..f05e8d4 100644
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGenerator.java
+++ b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGenerator.java
@@ -17,12 +17,7 @@
 
 package org.apache.servicecomb.transport.rest.vertx.accesslog;
 
-import java.util.List;
-
 import org.apache.servicecomb.transport.rest.vertx.accesslog.element.AccessLogItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.AccessLogItemFactory;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogPatternParser;
 
 import io.vertx.ext.web.RoutingContext;
 
@@ -37,15 +32,9 @@ public class AccessLogGenerator {
    */
   private AccessLogItem<RoutingContext>[] accessLogItems;
 
-  private AccessLogItemFactory accessLogItemFactory = new AccessLogItemFactory();
-
   @SuppressWarnings("unchecked")
-  public AccessLogGenerator(String rawPattern, AccessLogPatternParser accessLogPatternParser) {
-    List<AccessLogItemLocation> locationList = accessLogPatternParser.parsePattern(rawPattern);
-
-    List<AccessLogItem<RoutingContext>> itemList = accessLogItemFactory.createAccessLogItem(rawPattern, locationList);
-    accessLogItems = new AccessLogItem[itemList.size()];
-    accessLogItems = itemList.toArray(accessLogItems);
+  public AccessLogGenerator(String rawPattern) {
+    accessLogItems = new AccessLogItem[0];
   }
 
   public String generateLog(AccessLogParam<RoutingContext> accessLogParam) {
@@ -60,7 +49,6 @@ public class AccessLogGenerator {
     return log.toString();
   }
 
-
   private AccessLogItem<RoutingContext>[] getAccessLogItems() {
     return accessLogItems;
   }
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/AccessLogItemFactory.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/AccessLogItemFactory.java
deleted file mode 100644
index df1c47c..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/AccessLogItemFactory.java
+++ /dev/null
@@ -1,67 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.element;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.creator.AccessLogItemCreator;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.creator.PercentagePrefixConfigurableItemCreator;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.creator.SimpleAccessLogItemCreator;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-
-import io.vertx.ext.web.RoutingContext;
-
-/**
- * The factory of {@link AccessLogItem}.
- * Using the {@link AccessLogItemCreator} to generate AccessLogItem, according to {@link AccessLogItemLocation}
- * and rawPattern.
- */
-public class AccessLogItemFactory {
-  private List<AccessLogItemCreator<RoutingContext>> creatorList = Arrays
-      .asList(new SimpleAccessLogItemCreator(), new PercentagePrefixConfigurableItemCreator());
-
-  public List<AccessLogItem<RoutingContext>> createAccessLogItem(String rawPattern,
-      List<AccessLogItemLocation> locationList) {
-    List<AccessLogItem<RoutingContext>> itemList = new ArrayList<>(locationList.size());
-    for (AccessLogItemLocation location : locationList) {
-      setItemList(rawPattern, itemList, location);
-    }
-
-    return itemList;
-  }
-
-  /**
-   * generate single AccessLogItem
-   */
-  private void setItemList(String rawPattern, List<AccessLogItem<RoutingContext>> itemList,
-      AccessLogItemLocation location) {
-    AccessLogItem<RoutingContext> item = null;
-    for (AccessLogItemCreator<RoutingContext> creator : creatorList) {
-      item = creator.create(rawPattern, location);
-      if (null != item) {
-        break;
-      }
-    }
-
-    if (null != item) {
-      itemList.add(item);
-    }
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/AccessLogItemCreator.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/AccessLogItemCreator.java
deleted file mode 100644
index 5a31f1f..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/AccessLogItemCreator.java
+++ /dev/null
@@ -1,28 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.element.creator;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.AccessLogItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-
-/**
- * The actual creator of AccessLogItem.
- */
-public interface AccessLogItemCreator<T> {
-  AccessLogItem<T> create(String rawPattern, AccessLogItemLocation location);
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/PercentagePrefixConfigurableItemCreator.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/PercentagePrefixConfigurableItemCreator.java
deleted file mode 100644
index a22d3b0..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/PercentagePrefixConfigurableItemCreator.java
+++ /dev/null
@@ -1,68 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.element.creator;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.AccessLogItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.CookieItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.DatetimeConfigurableItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.InvocationContextItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.PlainTextItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.RequestHeaderItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.ResponseHeaderItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher.PercentagePrefixConfigurableMatcher;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-
-import io.vertx.ext.web.RoutingContext;
-
-/**
- * Some access log item contains changeable part, so we should get it's configuration from rawPattern, and generate it
- * each time it is needed.
- */
-public class PercentagePrefixConfigurableItemCreator implements AccessLogItemCreator<RoutingContext> {
-  @Override
-  public AccessLogItem<RoutingContext> create(String rawPattern, AccessLogItemLocation location) {
-    String config = getConfig(rawPattern, location);
-    switch (location.getPlaceHolder()) {
-      case DATETIME_CONFIGURABLE:
-        return new DatetimeConfigurableItem(config);
-      case REQUEST_HEADER:
-        return new RequestHeaderItem(config);
-      case RESPONSE_HEADER:
-        return new ResponseHeaderItem(config);
-      case COOKIE:
-        return new CookieItem(config);
-      case TEXT_PLAIN:
-        return new PlainTextItem(config);
-      case SCB_INVOCATION_CONTEXT:
-        return new InvocationContextItem(config);
-      default:
-        // unexpected situation
-        return null;
-    }
-  }
-
-  private String getConfig(String rawPattern, AccessLogItemLocation location) {
-    if (location.getPlaceHolder() == AccessLogItemTypeEnum.TEXT_PLAIN) {
-      return rawPattern.substring(location.getStart(), location.getEnd());
-    }
-    return rawPattern.substring(location.getStart() + PercentagePrefixConfigurableMatcher.GENERAL_PREFIX.length(),
-        location.getEnd()
-            - PercentagePrefixConfigurableMatcher.getSuffix(location.getPlaceHolder()).length());
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/SimpleAccessLogItemCreator.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/SimpleAccessLogItemCreator.java
deleted file mode 100644
index 3e4983e..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/SimpleAccessLogItemCreator.java
+++ /dev/null
@@ -1,76 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.element.creator;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.AccessLogItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.DatetimeConfigurableItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.DurationMillisecondItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.DurationSecondItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.FirstLineOfRequestItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.HttpMethodItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.HttpStatusItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.LocalHostItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.LocalPortItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.QueryStringItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.RemoteHostItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.RequestProtocolItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.ResponseSizeItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.TraceIdItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.UrlPathItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.UrlPathWithQueryItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-
-import io.vertx.ext.web.RoutingContext;
-
-/**
- * For some access log items, their placeholder contains no modifiable part, like "%s" or "sc-status".
- * So we can build a mapping relationship between the placeholder and item instances, when an item is needed, get it by
- * it's placeholder.
- */
-public class SimpleAccessLogItemCreator implements AccessLogItemCreator<RoutingContext> {
-  private static final Map<AccessLogItemTypeEnum, AccessLogItem<RoutingContext>> SIMPLE_ACCESSLOG_ITEM_MAP =
-      new HashMap<>();
-
-  static {
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.HTTP_METHOD, new HttpMethodItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.HTTP_STATUS, new HttpStatusItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.DURATION_IN_SECOND, new DurationSecondItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.DURATION_IN_MILLISECOND, new DurationMillisecondItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.REMOTE_HOSTNAME, new RemoteHostItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.LOCAL_HOSTNAME, new LocalHostItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.LOCAL_PORT, new LocalPortItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.RESPONSE_SIZE, new ResponseSizeItem("0"));
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.RESPONSE_SIZE_CLF, new ResponseSizeItem("-"));
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.FIRST_LINE_OF_REQUEST, new FirstLineOfRequestItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.URL_PATH, new UrlPathItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.QUERY_STRING, new QueryStringItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.URL_PATH_WITH_QUERY, new UrlPathWithQueryItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.REQUEST_PROTOCOL, new RequestProtocolItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.DATETIME_DEFAULT, new DatetimeConfigurableItem());
-    SIMPLE_ACCESSLOG_ITEM_MAP.put(AccessLogItemTypeEnum.SCB_TRACE_ID, new TraceIdItem());
-  }
-
-  @Override
-  public AccessLogItem<RoutingContext> create(String rawPattern, AccessLogItemLocation location) {
-    return SIMPLE_ACCESSLOG_ITEM_MAP.get(location.getPlaceHolder());
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/impl/AccessLogHandler.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/impl/AccessLogHandler.java
index 2acacb6..01b5676 100644
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/impl/AccessLogHandler.java
+++ b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/impl/AccessLogHandler.java
@@ -19,7 +19,6 @@ package org.apache.servicecomb.transport.rest.vertx.accesslog.impl;
 
 import org.apache.servicecomb.transport.rest.vertx.accesslog.AccessLogGenerator;
 import org.apache.servicecomb.transport.rest.vertx.accesslog.AccessLogParam;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogPatternParser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -31,8 +30,8 @@ public class AccessLogHandler implements Handler<RoutingContext> {
 
   private AccessLogGenerator accessLogGenerator;
 
-  public AccessLogHandler(String rawPattern, AccessLogPatternParser accessLogPatternParser) {
-    accessLogGenerator = new AccessLogGenerator(rawPattern, accessLogPatternParser);
+  public AccessLogHandler(String rawPattern) {
+    accessLogGenerator = new AccessLogGenerator(rawPattern);
   }
 
   @Override
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/AccessLogItemLocation.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/AccessLogItemLocation.java
deleted file mode 100644
index 8389ea2..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/AccessLogItemLocation.java
+++ /dev/null
@@ -1,86 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-
-import com.google.common.base.Objects;
-
-public class AccessLogItemLocation {
-  private int start;
-
-  private int end;
-
-  private AccessLogItemTypeEnum placeHolder;
-
-  public int getStart() {
-    return start;
-  }
-
-  public AccessLogItemLocation setStart(int start) {
-    this.start = start;
-    return this;
-  }
-
-  public int getEnd() {
-    return end;
-  }
-
-  public AccessLogItemLocation setEnd(int end) {
-    this.end = end;
-    return this;
-  }
-
-  public AccessLogItemTypeEnum getPlaceHolder() {
-    return placeHolder;
-  }
-
-  public AccessLogItemLocation setPlaceHolder(AccessLogItemTypeEnum placeHolder) {
-    this.placeHolder = placeHolder;
-    return this;
-  }
-
-  @Override
-  public String toString() {
-    final StringBuilder sb = new StringBuilder("AccessLogItemLocation{");
-    sb.append("start=").append(start);
-    sb.append(", end=").append(end);
-    sb.append(", placeHolder=").append(placeHolder);
-    sb.append('}');
-    return sb.toString();
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || !getClass().isAssignableFrom(o.getClass())) {
-      return false;
-    }
-    AccessLogItemLocation that = (AccessLogItemLocation) o;
-    return start == that.start
-        && end == that.end
-        && placeHolder == that.placeHolder;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hashCode(start, end, placeHolder);
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/AccessLogPatternParser.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/AccessLogPatternParser.java
deleted file mode 100644
index 4e3f3fc..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/AccessLogPatternParser.java
+++ /dev/null
@@ -1,27 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser;
-
-import java.util.List;
-
-/**
- * Parse the raw pattern, and generate a list of information about each access log item.
- */
-public interface AccessLogPatternParser {
-  List<AccessLogItemLocation> parsePattern(String rawPattern);
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/impl/DefaultAccessLogPatternParser.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/impl/DefaultAccessLogPatternParser.java
deleted file mode 100644
index 05e5649..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/impl/DefaultAccessLogPatternParser.java
+++ /dev/null
@@ -1,125 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogPatternParser;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher.AccessLogItemMatcher;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher.PercentagePrefixConfigurableMatcher;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher.SimpleItemMatcher;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DefaultAccessLogPatternParser implements AccessLogPatternParser {
-  private static final Logger LOGGER = LoggerFactory.getLogger(DefaultAccessLogPatternParser.class);
-
-  private static final List<AccessLogItemMatcher> matcherList = Arrays.asList(
-      new SimpleItemMatcher(), new PercentagePrefixConfigurableMatcher()
-  );
-
-  /**
-   * locate all kinds of access log item, and mark their type.
-   */
-  @Override
-  public List<AccessLogItemLocation> parsePattern(String rawPattern) {
-    LOGGER.info("parse access log pattern: [{}]", rawPattern);
-    List<AccessLogItemLocation> locationList = new ArrayList<>();
-    for (int i = 0; i < rawPattern.length(); ) {
-      AccessLogItemLocation location = match(rawPattern, i);
-      if (null == location) {
-        break;
-      }
-
-      locationList.add(location);
-      i = location.getEnd();
-    }
-
-    checkLocationList(rawPattern, locationList);
-
-    locationList = fillInTextPlain(rawPattern, locationList);
-
-    return locationList;
-  }
-
-  /**
-   * find out a placeholder that occurs firstly behind the offset index.
-   */
-  private AccessLogItemLocation match(String rawPattern, int offset) {
-    AccessLogItemLocation result = null;
-    for (AccessLogItemMatcher matcher : matcherList) {
-      AccessLogItemLocation location = matcher.match(rawPattern, offset);
-      if ((null == result) || (null != location && location.getStart() < result.getStart())) {
-        // if result is null or location is nearer to offset, use location as result
-        result = location;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * The content not matched in rawPattern will be printed as it is, so should be converted to {@link AccessLogItemTypeEnum#TEXT_PLAIN}
-   * @param rawPattern access log string pattern
-   * @param locationList {@link AccessLogItemLocation} list indicating the position of each access log item
-   */
-  private List<AccessLogItemLocation> fillInTextPlain(String rawPattern, List<AccessLogItemLocation> locationList) {
-    int cursor = 0;
-    List<AccessLogItemLocation> result = new ArrayList<>();
-
-    for (AccessLogItemLocation location : locationList) {
-      if (cursor == location.getStart()) {
-        result.add(location);
-      } else if (cursor < location.getStart()) {
-        result.add(new AccessLogItemLocation().setStart(cursor).setEnd(location.getStart()).setPlaceHolder(
-            AccessLogItemTypeEnum.TEXT_PLAIN));
-        result.add(location);
-      }
-      cursor = location.getEnd();
-    }
-
-    if (cursor < rawPattern.length()) {
-      result.add(new AccessLogItemLocation().setStart(cursor).setEnd(rawPattern.length())
-          .setPlaceHolder(AccessLogItemTypeEnum.TEXT_PLAIN));
-    }
-
-    return result;
-  }
-
-  /**
-   * If the access log items' location overlaps or is illegal(exceeding the boundary of the rawPattern),
-   * a {@link IllegalArgumentException} will be thrown out.
-   */
-  private void checkLocationList(String rawPattern, List<AccessLogItemLocation> locationList) {
-    int preEnd = -1;
-    for (AccessLogItemLocation location : locationList) {
-      if (preEnd > location.getStart()) {
-        throw new IllegalArgumentException("access log pattern contains illegal placeholder, please check it.");
-      }
-
-      preEnd = location.getEnd();
-    }
-
-    if (preEnd > rawPattern.length()) {
-      throw new IllegalArgumentException("access log pattern contains illegal placeholder, please check it.");
-    }
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/AccessLogItemMatcher.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/AccessLogItemMatcher.java
deleted file mode 100644
index 67d8b67..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/AccessLogItemMatcher.java
+++ /dev/null
@@ -1,28 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-
-public interface AccessLogItemMatcher {
-  /*
-   * Return an {@link AccessLogItemLocation} which matches part of rawPattern and is nearest to the offset(That means
-   * the {@link AccessLogItemLocation#start} is no less than offset and is smallest among the potential matched Item).
-   */
-  AccessLogItemLocation match(String rawPattern, int offset);
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/PercentagePrefixConfigurableMatcher.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/PercentagePrefixConfigurableMatcher.java
deleted file mode 100644
index 55e9d6b..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/PercentagePrefixConfigurableMatcher.java
+++ /dev/null
@@ -1,84 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher;
-
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-
-/**
- * for those access log item whose placeholder like "%{configpart}C"
- */
-public class PercentagePrefixConfigurableMatcher implements AccessLogItemMatcher {
-
-  public static final String GENERAL_PREFIX = "%{";
-
-  /**
-   * suffix to AccessLogItemTypeEnum
-   */
-  private static final Map<String, AccessLogItemTypeEnum> SUFFIX_PLACEHOLDER_ENUM_MAP = new LinkedHashMap<>();
-
-  /**
-   * AccessLogItemTypeEnum to suffix
-   */
-  private static final Map<AccessLogItemTypeEnum, String> ENUM_SUFFIX_MAP = new HashMap<>();
-
-  public static final String SUFFIX_HEAD = "}";
-
-  static {
-    SUFFIX_PLACEHOLDER_ENUM_MAP.put("}t", AccessLogItemTypeEnum.DATETIME_CONFIGURABLE);
-    SUFFIX_PLACEHOLDER_ENUM_MAP.put("}i", AccessLogItemTypeEnum.REQUEST_HEADER);
-    SUFFIX_PLACEHOLDER_ENUM_MAP.put("}o", AccessLogItemTypeEnum.RESPONSE_HEADER);
-    SUFFIX_PLACEHOLDER_ENUM_MAP.put("}C", AccessLogItemTypeEnum.COOKIE);
-    SUFFIX_PLACEHOLDER_ENUM_MAP.put("}SCB-ctx", AccessLogItemTypeEnum.SCB_INVOCATION_CONTEXT);
-
-    for (Entry<String, AccessLogItemTypeEnum> entry : SUFFIX_PLACEHOLDER_ENUM_MAP.entrySet()) {
-      ENUM_SUFFIX_MAP.put(entry.getValue(), entry.getKey());
-    }
-  }
-
-  @Override
-  public AccessLogItemLocation match(String rawPattern, int offset) {
-    int begin = rawPattern.indexOf(GENERAL_PREFIX, offset);
-    if (begin < 0) {
-      return null;
-    }
-
-    int end = rawPattern.indexOf(SUFFIX_HEAD, begin);
-    if (end < 0) {
-      return null;
-    }
-
-    for (Entry<String, AccessLogItemTypeEnum> entry : SUFFIX_PLACEHOLDER_ENUM_MAP.entrySet()) {
-      if (rawPattern.startsWith(entry.getKey(), end)) {
-        return new AccessLogItemLocation().setStart(begin).setEnd(end + entry.getKey().length())
-            .setPlaceHolder(entry.getValue());
-      }
-    }
-
-    return null;
-  }
-
-  public static String getSuffix(AccessLogItemTypeEnum accessLogItemTypeEnum) {
-    return ENUM_SUFFIX_MAP.get(accessLogItemTypeEnum);
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/SimpleItemMatcher.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/SimpleItemMatcher.java
deleted file mode 100644
index a3d6e93..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/SimpleItemMatcher.java
+++ /dev/null
@@ -1,78 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-
-/**
- * for those access log items whose placeholder has no changeable part.
- */
-public class SimpleItemMatcher implements AccessLogItemMatcher {
-  private static final Map<String, AccessLogItemTypeEnum> PLACEHOLDER_ENUM_MAP = new LinkedHashMap<>();
-
-  static {
-    PLACEHOLDER_ENUM_MAP.put("%m", AccessLogItemTypeEnum.HTTP_METHOD);
-    PLACEHOLDER_ENUM_MAP.put("cs-method", AccessLogItemTypeEnum.HTTP_METHOD);
-    PLACEHOLDER_ENUM_MAP.put("%s", AccessLogItemTypeEnum.HTTP_STATUS);
-    PLACEHOLDER_ENUM_MAP.put("sc-status", AccessLogItemTypeEnum.HTTP_STATUS);
-    PLACEHOLDER_ENUM_MAP.put("%T", AccessLogItemTypeEnum.DURATION_IN_SECOND);
-    PLACEHOLDER_ENUM_MAP.put("%D", AccessLogItemTypeEnum.DURATION_IN_MILLISECOND);
-    PLACEHOLDER_ENUM_MAP.put("%h", AccessLogItemTypeEnum.REMOTE_HOSTNAME);
-    PLACEHOLDER_ENUM_MAP.put("%v", AccessLogItemTypeEnum.LOCAL_HOSTNAME);
-    PLACEHOLDER_ENUM_MAP.put("%p", AccessLogItemTypeEnum.LOCAL_PORT);
-    PLACEHOLDER_ENUM_MAP.put("%B", AccessLogItemTypeEnum.RESPONSE_SIZE);
-    PLACEHOLDER_ENUM_MAP.put("%b", AccessLogItemTypeEnum.RESPONSE_SIZE_CLF);
-    PLACEHOLDER_ENUM_MAP.put("%r", AccessLogItemTypeEnum.FIRST_LINE_OF_REQUEST);
-    PLACEHOLDER_ENUM_MAP.put("%U", AccessLogItemTypeEnum.URL_PATH);
-    PLACEHOLDER_ENUM_MAP.put("cs-uri-stem", AccessLogItemTypeEnum.URL_PATH);
-    PLACEHOLDER_ENUM_MAP.put("%q", AccessLogItemTypeEnum.QUERY_STRING);
-    PLACEHOLDER_ENUM_MAP.put("cs-uri-query", AccessLogItemTypeEnum.QUERY_STRING);
-    PLACEHOLDER_ENUM_MAP.put("cs-uri", AccessLogItemTypeEnum.URL_PATH_WITH_QUERY);
-    PLACEHOLDER_ENUM_MAP.put("%H", AccessLogItemTypeEnum.REQUEST_PROTOCOL);
-    PLACEHOLDER_ENUM_MAP.put("%t", AccessLogItemTypeEnum.DATETIME_DEFAULT);
-    PLACEHOLDER_ENUM_MAP.put("%SCB-traceId", AccessLogItemTypeEnum.SCB_TRACE_ID);
-  }
-
-  @Override
-  public AccessLogItemLocation match(String rawPattern, int offset) {
-    int start = -1;
-    Entry<String, AccessLogItemTypeEnum> nearestEntry = null;
-    for (Entry<String, AccessLogItemTypeEnum> entry : PLACEHOLDER_ENUM_MAP.entrySet()) {
-      int cursor = rawPattern.indexOf(entry.getKey(), offset);
-      if (cursor < 0) {
-        continue;
-      }
-      if (start < 0 || cursor < start) {
-        start = cursor;
-        nearestEntry = entry;
-      }
-    }
-
-    if (null == nearestEntry) {
-      return null;
-    }
-
-    return new AccessLogItemLocation().setStart(start).setEnd(start + nearestEntry.getKey().length())
-        .setPlaceHolder(nearestEntry.getValue());
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGeneratorTest.java b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGeneratorTest.java
index a8a1186..1df6609 100644
--- a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGeneratorTest.java
+++ b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/AccessLogGeneratorTest.java
@@ -20,15 +20,12 @@ package org.apache.servicecomb.transport.rest.vertx.accesslog;
 import static org.junit.Assert.assertEquals;
 
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
 import java.util.TimeZone;
 
 import org.apache.servicecomb.transport.rest.vertx.accesslog.element.AccessLogItem;
 import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.DatetimeConfigurableItem;
 import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.HttpMethodItem;
 import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.PlainTextItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -40,16 +37,7 @@ import mockit.Deencapsulation;
 
 public class AccessLogGeneratorTest {
 
-  private static final AccessLogGenerator ACCESS_LOG_GENERATOR = new AccessLogGenerator("%m - %t",
-      rawPattern -> {
-        assertEquals("%m - %t", rawPattern);
-        return Arrays.asList(
-            new AccessLogItemLocation().setStart(0).setEnd(2).setPlaceHolder(AccessLogItemTypeEnum.HTTP_METHOD),
-            new AccessLogItemLocation().setStart(2).setEnd(5).setPlaceHolder(AccessLogItemTypeEnum.TEXT_PLAIN),
-            new AccessLogItemLocation().setStart(5)
-                .setEnd(7)
-                .setPlaceHolder(AccessLogItemTypeEnum.DATETIME_DEFAULT));
-      });
+  private static final AccessLogGenerator ACCESS_LOG_GENERATOR = new AccessLogGenerator("%m - %t");
 
   @Test
   public void testConstructor() {
diff --git a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/AccessLogItemFactoryTest.java b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/AccessLogItemFactoryTest.java
deleted file mode 100644
index 94b16e2..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/AccessLogItemFactoryTest.java
+++ /dev/null
@@ -1,56 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.element;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.DatetimeConfigurableItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.PlainTextItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.QueryStringItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.RequestHeaderItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.UrlPathWithQueryItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-import org.junit.Assert;
-import org.junit.Test;
-
-import io.vertx.ext.web.RoutingContext;
-
-public class AccessLogItemFactoryTest {
-  private static final String PATTERN = "test %{EEE, dd MMM yyyy HH:mm:ss zzz}t cs-uri-query cs-uri %{VARNAME1}i";
-
-  private static final List<AccessLogItemLocation> locationList = Arrays.asList(
-      new AccessLogItemLocation().setStart(0).setEnd(5).setPlaceHolder(AccessLogItemTypeEnum.TEXT_PLAIN),
-      new AccessLogItemLocation().setStart(5).setEnd(38).setPlaceHolder(AccessLogItemTypeEnum.DATETIME_CONFIGURABLE),
-      new AccessLogItemLocation().setStart(39).setEnd(51).setPlaceHolder(AccessLogItemTypeEnum.QUERY_STRING),
-      new AccessLogItemLocation().setStart(52).setEnd(58).setPlaceHolder(AccessLogItemTypeEnum.URL_PATH_WITH_QUERY),
-      new AccessLogItemLocation().setStart(59).setEnd(71).setPlaceHolder(AccessLogItemTypeEnum.REQUEST_HEADER));
-
-  @Test
-  public void testCreateAccessLogItem() {
-    List<AccessLogItem<RoutingContext>> itemList =
-        new AccessLogItemFactory().createAccessLogItem(PATTERN, locationList);
-    Assert.assertEquals(5, itemList.size());
-    Assert.assertEquals(PlainTextItem.class, itemList.get(0).getClass());
-    Assert.assertEquals(DatetimeConfigurableItem.class, itemList.get(1).getClass());
-    Assert.assertEquals(QueryStringItem.class, itemList.get(2).getClass());
-    Assert.assertEquals(UrlPathWithQueryItem.class, itemList.get(3).getClass());
-    Assert.assertEquals(RequestHeaderItem.class, itemList.get(4).getClass());
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/PercentagePrefixConfigurableItemCreatorTest.java b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/PercentagePrefixConfigurableItemCreatorTest.java
deleted file mode 100644
index cf3c343..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/element/creator/PercentagePrefixConfigurableItemCreatorTest.java
+++ /dev/null
@@ -1,106 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.element.creator;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.AccessLogItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.CookieItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.DatetimeConfigurableItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.InvocationContextItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.PlainTextItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.RequestHeaderItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.ResponseHeaderItem;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-import org.junit.Assert;
-import org.junit.Test;
-
-import io.vertx.ext.web.RoutingContext;
-
-public class PercentagePrefixConfigurableItemCreatorTest {
-  private static final String PATTERN = "test %{EEE, dd MMM yyyy HH:mm:ss zzz}t %{VARNAME1}i %{VARNAME2}o %{VARNAME3}C %{var name4}SCB-ctx";
-
-  private static final PercentagePrefixConfigurableItemCreator CREATOR = new PercentagePrefixConfigurableItemCreator();
-
-  @Test
-  public void testCreateDatetimeConfigurableItem() {
-    AccessLogItemLocation location = new AccessLogItemLocation().setStart(5).setEnd(38).setPlaceHolder(
-        AccessLogItemTypeEnum.DATETIME_CONFIGURABLE);
-
-    AccessLogItem<RoutingContext> item = CREATOR.create(PATTERN, location);
-
-    Assert.assertEquals(DatetimeConfigurableItem.class, item.getClass());
-    Assert.assertEquals("EEE, dd MMM yyyy HH:mm:ss zzz", ((DatetimeConfigurableItem) item).getPattern());
-  }
-
-  @Test
-  public void testCreateRequestHeaderItem() {
-    AccessLogItemLocation location = new AccessLogItemLocation().setStart(39).setEnd(51).setPlaceHolder(
-        AccessLogItemTypeEnum.REQUEST_HEADER);
-
-    AccessLogItem<RoutingContext> item = CREATOR.create(PATTERN, location);
-
-    Assert.assertEquals(RequestHeaderItem.class, item.getClass());
-    Assert.assertEquals("VARNAME1", ((RequestHeaderItem) item).getVarName());
-  }
-
-  @Test
-  public void testCreateResponseHeaderItem() {
-    AccessLogItemLocation location = new AccessLogItemLocation().setStart(52).setEnd(64).setPlaceHolder(
-        AccessLogItemTypeEnum.RESPONSE_HEADER);
-
-    AccessLogItem<RoutingContext> item = CREATOR.create(PATTERN, location);
-
-    Assert.assertEquals(ResponseHeaderItem.class, item.getClass());
-    Assert.assertEquals("VARNAME2", ((ResponseHeaderItem) item).getVarName());
-  }
-
-  @Test
-  public void testCreateCookieItem() {
-    AccessLogItemLocation location = new AccessLogItemLocation().setStart(65).setEnd(77).setPlaceHolder(
-        AccessLogItemTypeEnum.COOKIE);
-
-    AccessLogItem<RoutingContext> item = CREATOR.create(PATTERN, location);
-
-    Assert.assertEquals(CookieItem.class, item.getClass());
-    Assert.assertEquals("VARNAME3", ((CookieItem) item).getVarName());
-  }
-
-  @Test
-  public void testPlainTextItem() {
-    AccessLogItemLocation location = new AccessLogItemLocation().setStart(0)
-        .setEnd(5)
-        .setPlaceHolder(AccessLogItemTypeEnum.TEXT_PLAIN);
-
-    AccessLogItem<RoutingContext> item = CREATOR.create(PATTERN, location);
-
-    Assert.assertEquals(PlainTextItem.class, item.getClass());
-    Assert.assertEquals("test ", item.getFormattedItem(null));
-  }
-
-  @Test
-  public void testCreateInvocationContextItem() {
-    AccessLogItemLocation location = new AccessLogItemLocation().setStart(78)
-        .setEnd(97)
-        .setPlaceHolder(AccessLogItemTypeEnum.SCB_INVOCATION_CONTEXT);
-
-    AccessLogItem<RoutingContext> item = CREATOR.create(PATTERN, location);
-
-    Assert.assertEquals(InvocationContextItem.class, item.getClass());
-    Assert.assertEquals("var name4", ((InvocationContextItem) item).getVarName());
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/impl/DefaultAccessLogPatternParserTest.java b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/impl/DefaultAccessLogPatternParserTest.java
deleted file mode 100644
index efd0454..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/impl/DefaultAccessLogPatternParserTest.java
+++ /dev/null
@@ -1,119 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-import org.hamcrest.Matchers;
-import org.junit.Test;
-
-import mockit.Deencapsulation;
-
-public class DefaultAccessLogPatternParserTest {
-  private static final String ROW_PATTERN = "[cs-method] %m %s%T%D%h%v%p%B%b%r%U%q"
-      + "cs-uri-stemcs-uri-querycs-uri%H%t%{yyyy MM dd HH:mm:ss zzz}t"
-      + "%{yyyy MM dd HH:mm:ss|GMT+0|en-US}t"
-      + "%{incoming-header}i"
-      + "%{outgoing-header}o"
-      + "%{cookie}C"
-      + "%SCB-traceId"
-      + "%{invocationContext}SCB-ctx";
-
-  private static DefaultAccessLogPatternParser accessLogPatternParser = new DefaultAccessLogPatternParser();
-
-  @Test
-  public void testParsePattern() {
-    List<AccessLogItemLocation> result = accessLogPatternParser.parsePattern(ROW_PATTERN);
-    assertEquals(28, result.size());
-
-    assertThat(result.stream().map(AccessLogItemLocation::getPlaceHolder)
-            .filter(Objects::nonNull).collect(Collectors.toList()),
-        Matchers.contains(
-            AccessLogItemTypeEnum.TEXT_PLAIN,
-            AccessLogItemTypeEnum.HTTP_METHOD,
-            AccessLogItemTypeEnum.TEXT_PLAIN,
-            AccessLogItemTypeEnum.HTTP_METHOD,
-            AccessLogItemTypeEnum.TEXT_PLAIN,
-            AccessLogItemTypeEnum.HTTP_STATUS,
-            AccessLogItemTypeEnum.DURATION_IN_SECOND,
-            AccessLogItemTypeEnum.DURATION_IN_MILLISECOND,
-            AccessLogItemTypeEnum.REMOTE_HOSTNAME,
-            AccessLogItemTypeEnum.LOCAL_HOSTNAME,
-            AccessLogItemTypeEnum.LOCAL_PORT,
-            AccessLogItemTypeEnum.RESPONSE_SIZE,
-            AccessLogItemTypeEnum.RESPONSE_SIZE_CLF,
-            AccessLogItemTypeEnum.FIRST_LINE_OF_REQUEST,
-            AccessLogItemTypeEnum.URL_PATH,
-            AccessLogItemTypeEnum.QUERY_STRING,
-            AccessLogItemTypeEnum.URL_PATH,
-            AccessLogItemTypeEnum.QUERY_STRING,
-            AccessLogItemTypeEnum.URL_PATH_WITH_QUERY,
-            AccessLogItemTypeEnum.REQUEST_PROTOCOL,
-            AccessLogItemTypeEnum.DATETIME_DEFAULT,
-            AccessLogItemTypeEnum.DATETIME_CONFIGURABLE,
-            AccessLogItemTypeEnum.DATETIME_CONFIGURABLE,
-            AccessLogItemTypeEnum.REQUEST_HEADER,
-            AccessLogItemTypeEnum.RESPONSE_HEADER,
-            AccessLogItemTypeEnum.COOKIE,
-            AccessLogItemTypeEnum.SCB_TRACE_ID,
-            AccessLogItemTypeEnum.SCB_INVOCATION_CONTEXT));
-  }
-
-  @Test
-  public void testCheckLocationList() {
-    List<AccessLogItemLocation> locationList = new ArrayList<>(3);
-    locationList.add(new AccessLogItemLocation().setStart(0).setEnd(3));
-    locationList.add(new AccessLogItemLocation().setStart(3).setEnd(6));
-    locationList.add(new AccessLogItemLocation().setStart(5).setEnd(9));
-
-    try {
-      Deencapsulation.invoke(new DefaultAccessLogPatternParser(), "checkLocationList",
-          "0123456789", locationList);
-      fail("expect an exception");
-    } catch (Exception e) {
-      assertEquals(IllegalArgumentException.class, e.getClass());
-      assertEquals("access log pattern contains illegal placeholder, please check it.", e.getMessage());
-    }
-  }
-
-  @Test
-  public void testCheckLocationListOnLocationEndGreaterThanPatternLength() {
-    List<AccessLogItemLocation> locationList = new ArrayList<>(3);
-    locationList.add(new AccessLogItemLocation().setStart(0).setEnd(3));
-    locationList.add(new AccessLogItemLocation().setStart(3).setEnd(6));
-    locationList.add(new AccessLogItemLocation().setStart(7).setEnd(9));
-
-    try {
-      Deencapsulation.invoke(new DefaultAccessLogPatternParser(), "checkLocationList",
-          "0123456", locationList);
-      fail("expect an exception");
-    } catch (Exception e) {
-      assertEquals(IllegalArgumentException.class, e.getClass());
-      assertEquals("access log pattern contains illegal placeholder, please check it.", e.getMessage());
-    }
-  }
-}
diff --git a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/PercentagePrefixConfigurableMatcherTest.java b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/PercentagePrefixConfigurableMatcherTest.java
deleted file mode 100644
index d048999..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/PercentagePrefixConfigurableMatcherTest.java
+++ /dev/null
@@ -1,73 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class PercentagePrefixConfigurableMatcherTest {
-
-  public static final PercentagePrefixConfigurableMatcher MATCHER = new PercentagePrefixConfigurableMatcher();
-
-  public static final String TEST_RAW_PATTERN = "%{pattern}t %{test pattern}C %{test pattern}t %{test pattern}SCB-ctx";
-
-  @Test
-  public void testMatch() {
-    AccessLogItemLocation location;
-    location = MATCHER.match(TEST_RAW_PATTERN, 0);
-    Assert.assertEquals(
-        location,
-        new AccessLogItemLocation()
-            .setStart(0)
-            .setEnd(11)
-            .setPlaceHolder(AccessLogItemTypeEnum.DATETIME_CONFIGURABLE));
-
-    location = MATCHER.match(TEST_RAW_PATTERN, 10);
-    Assert.assertEquals(
-        location,
-        new AccessLogItemLocation()
-            .setStart(12)
-            .setEnd(28)
-            .setPlaceHolder(AccessLogItemTypeEnum.COOKIE));
-
-    location = MATCHER.match(TEST_RAW_PATTERN, 30);
-    Assert.assertEquals(
-        location,
-        new AccessLogItemLocation()
-            .setStart(46)
-            .setEnd(68)
-            .setPlaceHolder(AccessLogItemTypeEnum.SCB_INVOCATION_CONTEXT));
-
-    location = MATCHER.match(TEST_RAW_PATTERN, 47);
-    Assert.assertNull(location);
-  }
-
-  @Test
-  public void testNotMatch() {
-    AccessLogItemLocation location = MATCHER.match("notmatch", 0);
-    Assert.assertNull(location);
-  }
-
-  @Test
-  public void testNotMatchWithPrefix() {
-    AccessLogItemLocation location = MATCHER.match("%{notmatch}x", 0);
-    Assert.assertNull(location);
-  }
-}
\ No newline at end of file
diff --git a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/SimpleItemMatcherTest.java b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/SimpleItemMatcherTest.java
deleted file mode 100644
index 3ce57ae..0000000
--- a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/accesslog/parser/matcher/SimpleItemMatcherTest.java
+++ /dev/null
@@ -1,58 +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.
- */
-
-package org.apache.servicecomb.transport.rest.vertx.accesslog.parser.matcher;
-
-import org.apache.servicecomb.transport.rest.vertx.accesslog.parser.AccessLogItemLocation;
-import org.apache.servicecomb.transport.rest.vertx.accesslog.placeholder.AccessLogItemTypeEnum;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class SimpleItemMatcherTest {
-
-  private static final SimpleItemMatcher MATCHER = new SimpleItemMatcher();
-
-  public static final String PATTERN = "%h - - %t %r %s %B";
-
-  @Test
-  public void testMatch() {
-    AccessLogItemLocation location = MATCHER.match(PATTERN, 0);
-    Assert.assertEquals(
-        location,
-        new AccessLogItemLocation()
-            .setStart(0)
-            .setEnd(2)
-            .setPlaceHolder(AccessLogItemTypeEnum.REMOTE_HOSTNAME));
-
-    location = MATCHER.match(PATTERN, 3);
-    Assert.assertEquals(
-        location,
-        new AccessLogItemLocation()
-            .setStart(7)
-            .setEnd(9)
-            .setPlaceHolder(AccessLogItemTypeEnum.DATETIME_DEFAULT));
-
-    location = MATCHER.match(PATTERN, 17);
-    Assert.assertNull(location);
-  }
-
-  @Test
-  public void testNotMatch() {
-    AccessLogItemLocation location = MATCHER.match("notmatch", 0);
-    Assert.assertNull(location);
-  }
-}

-- 
To stop receiving notification emails like this one, please contact
wujimin@apache.org.