Package org.torproject.descriptor
Interface WebServerAccessLog
-
- All Superinterfaces:
Descriptor
,LogDescriptor
,java.io.Serializable
public interface WebServerAccessLog extends LogDescriptor
Contains a sanitized web server access log file from atorproject.org
web server.Parsing non-sanitized web server access logs from
torproject.org
web servers or other web servers is not explicitly supported, but may work anyway.- Since:
- 2.2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
WebServerAccessLog.Line
Facilitates access to all log line fields that don't only contain default values post sanitization.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.time.LocalDate
getLogDate()
Returns the date when requests contained in the log have been started, which is parsed from the log file path.java.lang.String
getPhysicalHost()
Returns the hostname of the physical host writing this log file, which is parsed from the log file path.java.util.List<java.lang.String>
getUnrecognizedLines()
Returns at most three unrecognized lines encountered while parsing the log.java.lang.String
getVirtualHost()
Returns the hostname of the virtual host that this log file was written for, which is parsed from the log file path.java.util.stream.Stream<WebServerAccessLog.Line>
logLines()
Returns a stream of all valid log lines.-
Methods inherited from interface org.torproject.descriptor.Descriptor
getDescriptorFile, getRawDescriptorLength
-
Methods inherited from interface org.torproject.descriptor.LogDescriptor
decompressedByteStream, getAnnotations, getRawDescriptorBytes
-
-
-
-
Method Detail
-
getLogDate
java.time.LocalDate getLogDate()
Returns the date when requests contained in the log have been started, which is parsed from the log file path.Typical web server access logs may contain date information in their file path, too, but that would be the date when the log file was rotated, which is not necessary the same date as the date in contained request lines.
- Since:
- 2.2.0
-
getPhysicalHost
java.lang.String getPhysicalHost()
Returns the hostname of the physical host writing this log file, which is parsed from the log file path.A physical host can serve multiple virtual hosts, and a virtual host can be served by multiple physical hosts.
- Since:
- 2.2.0
-
getVirtualHost
java.lang.String getVirtualHost()
Returns the hostname of the virtual host that this log file was written for, which is parsed from the log file path.A physical host can serve multiple virtual hosts, and a virtual host can be served by multiple physical hosts.
- Since:
- 2.2.0
-
getUnrecognizedLines
java.util.List<java.lang.String> getUnrecognizedLines()
Returns at most three unrecognized lines encountered while parsing the log.- Specified by:
getUnrecognizedLines
in interfaceDescriptor
- Specified by:
getUnrecognizedLines
in interfaceLogDescriptor
- Since:
- 2.2.0
-
logLines
java.util.stream.Stream<WebServerAccessLog.Line> logLines() throws DescriptorParseException
Returns a stream of all valid log lines.- Specified by:
logLines
in interfaceLogDescriptor
- Throws:
DescriptorParseException
- Since:
- 2.3.0
-
-