blob: ece9d0d2c4ac92c9aa7024fd8cac77885fe80780 (
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
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.logging;
import com.yahoo.component.AbstractComponent;
import com.yahoo.container.core.AccessLogConfig;
/**
* Log a message in Vespa JSON access log format.
*
* @author frodelu
* @author Tony Vaagenes
*/
public final class JSONAccessLog extends AbstractComponent implements RequestLogHandler {
private final AccessLogHandler logHandler;
public JSONAccessLog(AccessLogConfig config) {
logHandler = new AccessLogHandler(config.fileHandler(), new JSONFormatter());
}
@Override
public void log(RequestLogEntry entry) {
logHandler.log(entry);
}
@Override public void deconstruct() { logHandler.shutdown(); }
}
|