Class HttpRequestLogEntry
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
Represents a log entry for an HTTP request.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a sanitised version of this log entry.static StringSanitizes a header value based on the header key.static voidSanitizes a list of header values based on the header key.static voidSanitizes a map of header values based on the header key.static StringReplaces the final number of an IP address string with an asterisk.Formats this entry as an NCSA Combined Log Format line.toJson()Serializes this health stat object to a JSON string.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
HttpRequestLogEntry
public HttpRequestLogEntry()Constructs a new HTTP request log entry.
-
-
Method Details
-
getSanitised
Gets a sanitised version of this log entry.- Returns:
- a sanitised version of this log entry
-
toJson
Serializes this health stat object to a JSON string.- Returns:
- the JSON representation of this object
-
toCommonLogFormat
Formats this entry as an NCSA Combined Log Format line.Format:
host - - [dd/MMM/yyyy:HH:mm:ss Z] "method uri version" status bytes "referer" "user-agent"- Returns:
- the Combined Log Format string
-
sanitize
Sanitizes a map of header values based on the header key.- Parameters:
input- The map of header valuesoutput- The map to populate with sanitized values
-
sanitize
Sanitizes a list of header values based on the header key.- Parameters:
key- The header keyinput- The list of header valuesoutput- The list to populate with sanitized values
-
sanitize
Sanitizes a header value based on the header key.- Parameters:
key- The header keyvalue- The header value- Returns:
- The sanitized header value
-
sanitizeIpValue
Replaces the final number of an IP address string with an asterisk.- Parameters:
ip- The input IP address (e.g., "10.0.0.1")- Returns:
- The masked IP string (e.g., "10.0.0.*")
-