Class QFSFormatter
- java.lang.Object
-
- java.util.logging.Formatter
-
- com.activeviam.risk.starter.logging.QFSFormatter
-
public class QFSFormatter extends Formatter
Simple log record formatter that logs the user authenticated with the current thread, and the name of that thread.Retrieving the authenticated user is done (and only works with) the Spring Security framework.
The formatter can be configured with those system properties:
- -DlogThread=true
- -DlogUser=true
- -DlogLoggerName=true
- Author:
- ActiveViam
-
-
Field Summary
Fields Modifier and Type Field Description static String
LOG_LOGGER_NAME_PROPERTY
System property to activate logging the name of the loggerstatic String
LOG_THREAD_PROPERTY
System property to activate logging the current threadstatic String
LOG_USER_PROPERTY
System property to activate logging the current userprotected boolean
logLoggerName
Flag to log the name of the loggerprotected boolean
logThread
Flag to log the current threadprotected boolean
logUser
Flag to log the current userprotected Calendar
time
Current time
-
Constructor Summary
Constructors Constructor Description QFSFormatter()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(LogRecord record)
String
getCurrentThread()
String
getCurrentUser()
Retrieve the current user authenticated with the current thread.-
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
-
-
-
Field Detail
-
LOG_USER_PROPERTY
public static final String LOG_USER_PROPERTY
System property to activate logging the current user- See Also:
- Constant Field Values
-
LOG_THREAD_PROPERTY
public static final String LOG_THREAD_PROPERTY
System property to activate logging the current thread- See Also:
- Constant Field Values
-
LOG_LOGGER_NAME_PROPERTY
public static final String LOG_LOGGER_NAME_PROPERTY
System property to activate logging the name of the logger- See Also:
- Constant Field Values
-
time
protected final Calendar time
Current time
-
logThread
protected final boolean logThread
Flag to log the current thread
-
logUser
protected final boolean logUser
Flag to log the current user
-
logLoggerName
protected final boolean logLoggerName
Flag to log the name of the logger
-
-