blob: 6d1baf0423f45f6ef5bb9b64ac0ad650b14087ca (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http.server.jetty;
import com.yahoo.container.logging.ConnectionLog;
import com.yahoo.container.logging.ConnectionLogEntry;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* A {@link ConnectionLog} that aggregates log entries in memory
*
* @author bjorncs
*/
class InMemoryConnectionLog implements ConnectionLog {
private final List<ConnectionLogEntry> logEntries = new CopyOnWriteArrayList<>();
@Override
public void log(ConnectionLogEntry entry) {
logEntries.add(entry);
}
List<ConnectionLogEntry> logEntries() { return logEntries; }
}
|