Package com.pingidentity.sdk.logging
Class LoggingUtil
java.lang.Object
com.pingidentity.sdk.logging.LoggingUtil
PingFederate sdks can use this utility class to write to audit log.
- Since:
- 10.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 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 voidSet the event type.static voidSet 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 voidSet the logging server's role such as, AS (Authorisation Server), IdP (Identity Provider), SP (Service Provider).static voidSet a status for the log entry.static voidsetUserName(String username) Set the username.static voidUpdate the response time using current time and the requestStartTime.
-
Field Details
-
SUCCESS
- See Also:
-
FAILURE
- See Also:
-
-
Method Details
-
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
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
Set a status for the log entry.- Parameters:
status-- Since:
- 10.0
-
setUserName
Set the username. The substitution name for the @{username} in audit log is subject.- Parameters:
username-- Since:
- 10.0
-
setPartnerId
Sets the partner id. The substitution name for in audit log is connectionid .- Parameters:
partnerId-- Since:
- 10.0
-
setInMessageContext
Sets the incoming message context id. The substitution name for in audit log is inxmlmsg .- Parameters:
inMessageContext-- Since:
- 10.0
-
setOutMessageContext
Sets the outgoing message context. The substitution name for in audit log is outxmlmsg .- Parameters:
outMessageContext-- Since:
- 10.0
-
setHost
Set the hostname.- Parameters:
host-- Since:
- 10.0
-
setRemoteAddress
Set the remote address.- Parameters:
remoteAddress-- Since:
- 10.0
-
setProtocol
Set the protocol.- Parameters:
protocol-- Since:
- 10.0
-
setRequestStartTime
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
Set the event type.- Parameters:
event-- Since:
- 10.0
-
getEvent
Get the type of event being logged.- Since:
- 10.0
-
setDescription
Set the description for log entry.- Parameters:
description-- Since:
- 10.0
-
setRole
Set the logging server's role such as, AS (Authorisation Server), IdP (Identity Provider), SP (Service Provider).- Parameters:
role-- Since:
- 10.0
-
setAccessTokenJti
Sets the jti of an outbound JWT access token.- Parameters:
jti- the jti of an outbound JWT access token- Since:
- 11.3
-
setRequestJti
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
-
calculateHashForLogging
Calculates a hash for the given value. The calculated hash can be used for logging.- Parameters:
value- the value to hash- Returns:
- the generated hash, or null if the given value is blank
- Since:
- 11.3
-