Package com.pingidentity.sdk.logging
Class LoggingUtil
- java.lang.Object
-
- com.pingidentity.sdk.logging.LoggingUtil
-
public final class LoggingUtil extends Object
PingFederate sdks can use this utility class to write to audit log.- Since:
- 10.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcalculateHashForLogging(String value)Calculates a hash for the given value.static voidcleanup()Clears the thread's local parameters filled during and after initialization.static StringgetEvent()Get the type of event being logged.static voidinit()Initiate an audit log event.static voidlog(String msg)Log a message.static voidsetAccessTokenJti(String jti)Sets the jti of an outbound JWT access token.static voidsetDescription(String description)Set the description for log entry.static voidsetEvent(String event)Set the event type.static voidsetHost(String host)Set the hostname.static voidsetInMessageContext(String inMessageContext)Sets the incoming message context id.static voidsetOutMessageContext(String outMessageContext)Sets the outgoing message context.static voidsetPartnerId(String partnerId)Sets the partner id.static voidsetProtocol(String protocol)Set the protocol.static voidsetRemoteAddress(String remoteAddress)Set the remote address.static voidsetRequestJti(String jti)Sets the jti of inbound JWT access token.static voidsetRequestStartTime(Long startTime)Set the request start time.static voidsetRole(String role)Set the logging server's role such as, AS (Authorisation Server), IdP (Identity Provider), SP (Service Provider).static voidsetStatus(String status)Set a status for the log entry.static voidsetUserName(String username)Set the username.static voidupdateResponseTime()Update the response time using current time and the requestStartTime.
-
-
-
Field Detail
-
SUCCESS
public static final String SUCCESS
- See Also:
- Constant Field Values
-
FAILURE
public static final String FAILURE
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public static void init()
Initiate an audit log event. Audit log parameters can be filled in during the life cycle of the event. The audit log will be written to disk when the write method is invoked. It is the responsibility of the caller to clear the thread local parameters.
-
log
public static void log(String msg)
Log a message.- Parameters:
msg-- Since:
- 10.0
-
cleanup
public static void cleanup()
Clears the thread's local parameters filled during and after initialization.- Since:
- 10.0
-
setStatus
public static void setStatus(String status)
Set a status for the log entry.- Parameters:
status-- Since:
- 10.0
-
setUserName
public static void setUserName(String username)
Set the username. The substitution name for the @{username} in audit log is subject.- Parameters:
username-- Since:
- 10.0
-
setPartnerId
public static void setPartnerId(String partnerId)
Sets the partner id. The substitution name for {@param partnerId} in audit log is connectionid .- Parameters:
partnerId-- Since:
- 10.0
-
setInMessageContext
public static void setInMessageContext(String inMessageContext)
Sets the incoming message context id. The substitution name for {@param inMessageContext} in audit log is inxmlmsg .- Parameters:
inMessageContext-- Since:
- 10.0
-
setOutMessageContext
public static void setOutMessageContext(String outMessageContext)
Sets the outgoing message context. The substitution name for {@param outMessageContext} in audit log is outxmlmsg .- Parameters:
outMessageContext-- Since:
- 10.0
-
setHost
public static void setHost(String host)
Set the hostname.- Parameters:
host-- Since:
- 10.0
-
setRemoteAddress
public static void setRemoteAddress(String remoteAddress)
Set the remote address.- Parameters:
remoteAddress-- Since:
- 10.0
-
setProtocol
public static void setProtocol(String protocol)
Set the protocol.- Parameters:
protocol-- Since:
- 10.0
-
setRequestStartTime
public static void setRequestStartTime(Long startTime)
Set the request start time.- Parameters:
startTime-- Since:
- 10.0
-
updateResponseTime
public static void updateResponseTime()
Update the response time using current time and the requestStartTime.- Since:
- 10.0
-
setEvent
public static void setEvent(String event)
Set the event type.- Parameters:
event-- Since:
- 10.0
-
getEvent
public static String getEvent()
Get the type of event being logged.- Since:
- 10.0
-
setDescription
public static void setDescription(String description)
Set the description for log entry.- Parameters:
description-- Since:
- 10.0
-
setRole
public static void setRole(String role)
Set the logging server's role such as, AS (Authorisation Server), IdP (Identity Provider), SP (Service Provider).- Parameters:
role-- Since:
- 10.0
-
setAccessTokenJti
public static void setAccessTokenJti(String jti)
Sets the jti of an outbound JWT access token.- Parameters:
jti- the jti of an outbound JWT access token- Since:
- 11.3
-
setRequestJti
public static void setRequestJti(String jti)
Sets the jti of inbound JWT access token.
If the thread already has this parameter set, then the new value will be appended to it using a comma separator.- Parameters:
jti- the jti of inbound JWT access token- Since:
- 11.3
-
-