Class 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 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
    • Constructor Detail

      • QFSFormatter

        public QFSFormatter()
        Constructor
    • Method Detail

      • getCurrentThread

        public String getCurrentThread()
      • getCurrentUser

        public String getCurrentUser()
        Retrieve the current user authenticated with the current thread.
        Returns:
        current authenticated user, or null if no user is authenticated with the current thread.