dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zxbu (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] zxbu commented on issue #9: AccessLogFilter 产生的日志不完整
Date Tue, 18 Dec 2018 09:21:59 GMT
你看下`com.alibaba.dubbo.rpc.filter.AccessLogFilter`源码,记录日志时实际上是异步的,
下面是源码中的片段,当logSet超过LOG_MAX_BUFFER时,就被会丢弃掉。
```
    private static final int LOG_MAX_BUFFER = 5000;

    private void log(String accesslog, String logmessage) {
        init();
        Set<String> logSet = logQueue.get(accesslog);
        if (logSet == null) {
            logQueue.putIfAbsent(accesslog, new ConcurrentHashSet<String>());
            logSet = logQueue.get(accesslog);
        }
        if (logSet.size() < LOG_MAX_BUFFER) {
            logSet.add(logmessage);
        }
    }
```

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/9 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
Mime
View raw message