public class ServletLogUtility extends Object
Modifier and Type | Method | Description |
---|---|---|
static String |
composeLogMessage(javax.servlet.http.HttpServletRequest httpRequest) |
Composes a log message with the method, the client IP address, CORS
origin (if any and a CORS Filter is configured) and the security
client certificate principal (if any) of an HTTP request.
|
static void |
log(javax.servlet.http.HttpServletRequest httpRequest) |
Logs (at INFO level) the method, the client IP address, CORS origin
(if any and a CORS Filter is configured) and the security client
certificate principal (if any) of an HTTP request.
|
static void |
log(org.apache.logging.log4j.Logger log,
javax.servlet.http.HttpServletRequest httpRequest) |
Logs (at INFO level) the method, the client IP address, CORS origin
(if any and a CORS Filter is configured) and the security client
certificate principal (if any) of an HTTP request.
|
public static String composeLogMessage(javax.servlet.http.HttpServletRequest httpRequest)
Example:
HTTP POST request: ip=127.0.0.1 path=/json2ldap HTTPS POST request: ip=192.168.0.1 path=/authservice HTTPS CORS GET request: ip=192.168.0.1 origin=192.168.10.20 path=/json2ldap
httpRequest
- The HTTP request. Must not be null
.public static void log(javax.servlet.http.HttpServletRequest httpRequest)
Example:
HTTP POST request: ip=127.0.0.1 path=/json2ldap HTTPS POST request: ip=192.168.0.1 path=/authservice HTTPS CORS GET request: ip=192.168.0.1 origin=192.168.10.20 path=/json2ldap
httpRequest
- The HTTP request to log. If null
the
method will return immediately.public static void log(org.apache.logging.log4j.Logger log, javax.servlet.http.HttpServletRequest httpRequest)
Example:
HTTP POST request: ip=127.0.0.1 path=/json2ldap HTTPS POST request: ip=192.168.0.1 path=/authservice HTTPS CORS GET request: ip=192.168.0.1 origin=192.168.10.20 path=/json2ldap
log
- The logger. If true
the method will
return immediately.httpRequest
- The HTTP request to log. If null
the
method will return immediately.Copyright © 2018 Connect2id. All rights reserved.