blob: 86cdd7120310723846461c4facff803b19f354d7 (
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
26
27
28
29
30
31
32
33
34
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.logging;
import com.google.inject.Inject;
import com.yahoo.component.provider.ComponentRegistry;
import java.net.InetSocketAddress;
import java.net.URI;
/**
* Logs to all the configured access logs.
* @author tonytv
*/
public class AccessLog {
private ComponentRegistry<AccessLogInterface> implementers;
@Inject
public AccessLog(ComponentRegistry<AccessLogInterface> implementers) {
this.implementers = implementers;
}
public static AccessLog voidAccessLog() {
return new AccessLog(new ComponentRegistry<>());
}
public void log(final AccessLogEntry accessLogEntry) {
for (AccessLogInterface log: implementers.allComponents()) {
log.log(accessLogEntry);
}
}
}
|