test_class.declarator: accessLogFilter = new AccessLogFilter()
test_class.original_string: Filter accessLogFilter = new AccessLogFilter();
test_class.type: Filter
test_class.var_name: accessLogFilter
test_class.file: dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/filter/AccessLogFilterTest.java
test_class.identifier: AccessLogFilterTest
test_case.body: @Test
      public void testDefault() {
          URL url = URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1");
          Invoker<AccessLogFilterTest> invoker = new MyInvoker<AccessLogFilterTest>(url);
          Invocation invocation = new MockInvocation();
          accessLogFilter.invoke(invoker, invocation);
      }
test_case.class_method_signature: AccessLogFilterTest.testDefault()
test_case.full_signature: @Test public void testDefault()
test_case.identifier: testDefault
test_case.invocations: valueOf invoke
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDefault()
focal_class.declarator: logger = LoggerFactory.getLogger(AccessLogFilter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(AccessLogFilter.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: ACCESS_LOG_KEY = "dubbo.accesslog"
focal_class.modifier: private static final
focal_class.original_string: private static final String ACCESS_LOG_KEY = "dubbo.accesslog";
focal_class.type: String
focal_class.var_name: ACCESS_LOG_KEY
focal_class.declarator: FILE_DATE_FORMAT = "yyyyMMdd"
focal_class.modifier: private static final
focal_class.original_string: private static final String FILE_DATE_FORMAT = "yyyyMMdd";
focal_class.type: String
focal_class.var_name: FILE_DATE_FORMAT
focal_class.declarator: MESSAGE_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"
focal_class.modifier: private static final
focal_class.original_string: private static final String MESSAGE_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
focal_class.type: String
focal_class.var_name: MESSAGE_DATE_FORMAT
focal_class.declarator: LOG_MAX_BUFFER = 5000
focal_class.modifier: private static final
focal_class.original_string: private static final int LOG_MAX_BUFFER = 5000;
focal_class.type: int
focal_class.var_name: LOG_MAX_BUFFER
focal_class.declarator: LOG_OUTPUT_INTERVAL = 5000
focal_class.modifier: private static final
focal_class.original_string: private static final long LOG_OUTPUT_INTERVAL = 5000;
focal_class.type: long
focal_class.var_name: LOG_OUTPUT_INTERVAL
focal_class.declarator: logQueue = new ConcurrentHashMap<String, Set<String>>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<String, Set<String>> logQueue = new ConcurrentHashMap<String, Set<String>>();
focal_class.type: ConcurrentMap<String, Set<String>>
focal_class.var_name: logQueue
focal_class.declarator: logScheduled = Executors.newScheduledThreadPool(2, new NamedThreadFactory("Dubbo-Access-Log", true))
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService logScheduled = Executors.newScheduledThreadPool(2, new NamedThreadFactory("Dubbo-Access-Log", true));
focal_class.type: ScheduledExecutorService
focal_class.var_name: logScheduled
focal_class.declarator: logFuture = null
focal_class.modifier: private volatile
focal_class.original_string: private volatile ScheduledFuture<?> logFuture = null;
focal_class.type: ScheduledFuture<?>
focal_class.var_name: logFuture
focal_class.file: dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/AccessLogFilter.java
focal_class.identifier: AccessLogFilter
focal_class.interfaces: implements Filter
focal_class.class_method_signature: AccessLogFilter.init()
focal_class.full_signature: private void init()
focal_class.identifier: init
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: AccessLogFilter.log(String accesslog, String logmessage)
focal_class.full_signature: private void log(String accesslog, String logmessage)
focal_class.identifier: log
focal_class.modifiers: private
focal_class.parameters: (String accesslog, String logmessage)
focal_class.return: void
focal_class.signature: void log(String accesslog, String logmessage)
focal_class.class_method_signature: AccessLogFilter.invoke(Invoker<?> invoker, Invocation inv)
focal_class.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation inv)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (Invoker<?> invoker, Invocation inv)
focal_class.return: Result
focal_class.signature: Result invoke(Invoker<?> invoker, Invocation inv)
focal_method.body: @Override
      public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException {
          try {
              String accesslog = invoker.getUrl().getParameter(Constants.ACCESS_LOG_KEY);
              if (ConfigUtils.isNotEmpty(accesslog)) {
                  RpcContext context = RpcContext.getContext();
                  String serviceName = invoker.getInterface().getName();
                  String version = invoker.getUrl().getParameter(Constants.VERSION_KEY);
                  String group = invoker.getUrl().getParameter(Constants.GROUP_KEY);
                  StringBuilder sn = new StringBuilder();
                  sn.append("[").append(new SimpleDateFormat(MESSAGE_DATE_FORMAT).format(new Date())).append("] ").append(context.getRemoteHost()).append(":").append(context.getRemotePort())
                          .append(" -> ").append(context.getLocalHost()).append(":").append(context.getLocalPort())
                          .append(" - ");
                  if (null != group && group.length() > 0) {
                      sn.append(group).append("/");
                  }
                  sn.append(serviceName);
                  if (null != version && version.length() > 0) {
                      sn.append(":").append(version);
                  }
                  sn.append(" ");
                  sn.append(inv.getMethodName());
                  sn.append("(");
                  Class<?>[] types = inv.getParameterTypes();
                  if (types != null && types.length > 0) {
                      boolean first = true;
                      for (Class<?> type : types) {
                          if (first) {
                              first = false;
                          } else {
                              sn.append(",");
                          }
                          sn.append(type.getName());
                      }
                  }
                  sn.append(") ");
                  Object[] args = inv.getArguments();
                  if (args != null && args.length > 0) {
                      sn.append(JSON.toJSONString(args));
                  }
                  String msg = sn.toString();
                  if (ConfigUtils.isDefault(accesslog)) {
                      LoggerFactory.getLogger(ACCESS_LOG_KEY + "." + invoker.getInterface().getName()).info(msg);
                  } else {
                      log(accesslog, msg);
                  }
              }
          } catch (Throwable t) {
              logger.warn("Exception in AcessLogFilter of service(" + invoker + " -> " + inv + ")", t);
          }
          return invoker.invoke(inv);
      }
focal_method.class_method_signature: AccessLogFilter.invoke(Invoker<?> invoker, Invocation inv)
focal_method.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation inv)
focal_method.identifier: invoke
focal_method.invocations: getParameter getUrl isNotEmpty getContext getName getInterface getParameter getUrl getParameter getUrl append append append append append append append append append append append format getRemoteHost getRemotePort getLocalHost getLocalPort length append append append length append append append append getMethodName append getParameterTypes append append getName append getArguments append toJSONString toString isDefault info getLogger getName getInterface log warn invoke
focal_method.modifiers: @Override public
focal_method.parameters: (Invoker<?> invoker, Invocation inv)
focal_method.return: Result
focal_method.signature: Result invoke(Invoker<?> invoker, Invocation inv)