aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/InMemoryRequestLog.java
blob: d22f49fab9ad670d393eeff8b4966a8786496c04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. 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.RequestLog;
import com.yahoo.container.logging.RequestLogEntry;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author bjorncs
 */
public class InMemoryRequestLog implements RequestLog {

    private final List<RequestLogEntry> entries = new CopyOnWriteArrayList<>();

    @Override public void log(RequestLogEntry entry) { entries.add(entry); }

    List<RequestLogEntry> entries() { return entries; }
}