Interface SessionLog

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      PUBLIC: Clone the log.
      void config​(java.lang.String message)
      PUBLIC: This method is called when a config level message needs to be logged.
      void fine​(java.lang.String message)
      PUBLIC: This method is called when a fine level message needs to be logged.
      void finer​(java.lang.String message)
      PUBLIC: This method is called when a finer level message needs to be logged.
      void finest​(java.lang.String message)
      PUBLIC: This method is called when a finest level message needs to be logged.
      int getLevel()
      PUBLIC: Return the log level.
      int getLevel​(java.lang.String category)
      PUBLIC: Return the log level; category is only needed where name space is available.
      java.lang.String getLevelString()
      PUBLIC:
      Session getSession()
      PUBLIC: Get the session that owns this SessionLog.
      java.io.Writer getWriter()
      PUBLIC: Return the writer to which an accessor writes logged messages and SQL.
      void info​(java.lang.String message)
      PUBLIC: This method is called when a info level message needs to be logged.
      void log​(int level, java.lang.String message)
      PUBLIC: Log a message that does not need to be translated.
      void log​(int level, java.lang.String message, java.lang.Object param)
      PUBLIC: Log a message with one parameter that needs to be translated.
      void log​(int level, java.lang.String message, java.lang.Object[] arguments)
      PUBLIC: This method is called when the log request is from somewhere session is not available.
      void log​(int level, java.lang.String message, java.lang.Object[] arguments, boolean shouldTranslate)
      PUBLIC: This method is called when the log request is from somewhere session is not available.
      void log​(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2)
      PUBLIC: Log a message with two parameters that needs to be translated.
      void log​(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
      PUBLIC: Log a message with three parameters that needs to be translated.
      void log​(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3, java.lang.Object param4)
      PUBLIC: Log a message with four parameters that needs to be translated.
      void log​(int level, java.lang.String category, java.lang.String message, java.lang.Object param)
      PUBLIC: Log a message with one parameter that needs to be translated.
      void log​(int level, java.lang.String category, java.lang.String message, java.lang.Object[] arguments)
      PUBLIC: This method is called when the log request is from somewhere session is not available.
      void log​(int level, java.lang.String category, java.lang.String message, java.lang.Object[] arguments, boolean shouldTranslate)
      PUBLIC: This method is called when the log request is from somewhere session is not available.
      void log​(int level, java.lang.String category, java.lang.String message, java.lang.Object param1, java.lang.Object param2)
      PUBLIC: Log a message with two parameters that needs to be translated.
      void log​(int level, java.lang.String category, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
      PUBLIC: Log a message with three parameters that needs to be translated.
      void log​(int level, java.lang.String category, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3, java.lang.Object param4)
      PUBLIC: Log a message with four parameters that needs to be translated.
      void log​(SessionLogEntry entry)
      PUBLIC: EclipseLink will call this method whenever something needs to be logged (messages, SQL, etc.).
      void logThrowable​(int level, java.lang.String category, java.lang.Throwable throwable)
      PUBLIC: Log a throwable with level.
      void logThrowable​(int level, java.lang.Throwable throwable)
      PUBLIC: Log a Throwable with level.
      void setLevel​(int level)
      PUBLIC: Set the log level.
      void setLevel​(int level, java.lang.String category)
      PUBLIC: Set the log level.
      void setSession​(Session session)
      PUBLIC: Set the session that owns this SessionLog.
      void setShouldDisplayData​(java.lang.Boolean shouldDisplayData)
      Set whether bind parameters should be displayed when logging SQL.
      void setShouldLogExceptionStackTrace​(boolean flag)
      By default stack trace is logged for SEVERE all the time and at FINER level for WARNING or less.
      void setShouldPrintConnection​(boolean flag)
      By default the connection is always printed whenever available, this can be turned off.
      void setShouldPrintDate​(boolean flag)
      By default date is printed, this can be turned off.
      void setShouldPrintSession​(boolean flag)
      By default the Session is always printed whenever available, this can be turned off.
      void setShouldPrintThread​(boolean flag)
      By default the thread is logged at FINE or less level, this can be turned off.
      void setWriter​(java.io.Writer log)
      PUBLIC: Set the writer to which an accessor writes logged messages and SQL.
      void severe​(java.lang.String message)
      PUBLIC: This method is called when a severe level message needs to be logged.
      boolean shouldDisplayData()
      Return whether bind parameters should be displayed when logging SQL, default is true.
      boolean shouldLog​(int level)
      PUBLIC: Check if a message of the given level would actually be logged.
      boolean shouldLog​(int level, java.lang.String category)
      PUBLIC: Check if a message of the given level would actually be logged.
      boolean shouldLogExceptionStackTrace()
      By default the stack trace is logged for SEVERE all the time and at FINER level for WARNING or less, this can be turned off.
      boolean shouldPrintConnection()
      By default the connection is always printed whenever available, this can be turned off.
      boolean shouldPrintDate()
      By default the date is always printed, this can be turned off.
      boolean shouldPrintSession()
      By default the Session is always printed whenever available, this can be turned off.
      boolean shouldPrintThread()
      By default the thread is logged at FINE or less level, this can be turned off.
      void throwing​(java.lang.Throwable throwable)
      PUBLIC: This method is called when a throwable at finer level needs to be logged.
      void warning​(java.lang.String message)
      PUBLIC: This method is called when a warning level message needs to be logged.
    • Method Detail

      • log

        void log​(SessionLogEntry entry)
        PUBLIC: EclipseLink will call this method whenever something needs to be logged (messages, SQL, etc.). All the pertinent information will be contained in the specified entry.
        Parameters:
        entry - org.eclipse.persistence.sessions.LogEntry
      • shouldLogExceptionStackTrace

        boolean shouldLogExceptionStackTrace()
        By default the stack trace is logged for SEVERE all the time and at FINER level for WARNING or less, this can be turned off.
      • shouldPrintDate

        boolean shouldPrintDate()
        By default the date is always printed, this can be turned off.
      • shouldPrintThread

        boolean shouldPrintThread()
        By default the thread is logged at FINE or less level, this can be turned off.
      • shouldDisplayData

        boolean shouldDisplayData()
        Return whether bind parameters should be displayed when logging SQL, default is true.
      • shouldPrintConnection

        boolean shouldPrintConnection()
        By default the connection is always printed whenever available, this can be turned off.
      • shouldPrintSession

        boolean shouldPrintSession()
        By default the Session is always printed whenever available, this can be turned off.
      • setShouldDisplayData

        void setShouldDisplayData​(java.lang.Boolean shouldDisplayData)
        Set whether bind parameters should be displayed when logging SQL.
      • setShouldLogExceptionStackTrace

        void setShouldLogExceptionStackTrace​(boolean flag)
        By default stack trace is logged for SEVERE all the time and at FINER level for WARNING or less. This can be turned off.
      • setShouldPrintDate

        void setShouldPrintDate​(boolean flag)
        By default date is printed, this can be turned off.
      • setShouldPrintThread

        void setShouldPrintThread​(boolean flag)
        By default the thread is logged at FINE or less level, this can be turned off.
      • setShouldPrintConnection

        void setShouldPrintConnection​(boolean flag)
        By default the connection is always printed whenever available, this can be turned off.
      • setShouldPrintSession

        void setShouldPrintSession​(boolean flag)
        By default the Session is always printed whenever available, this can be turned off.
      • getWriter

        java.io.Writer getWriter()
        PUBLIC: Return the writer to which an accessor writes logged messages and SQL. If not set, this reference usually defaults to a writer on System.out. To enable logging, logMessages must be turned on in the session.
      • setWriter

        void setWriter​(java.io.Writer log)
        PUBLIC: Set the writer to which an accessor writes logged messages and SQL. If not set, this reference usually defaults to a writer on System.out. To enable logging, logMessages() is used on the session.
      • getLevelString

        java.lang.String getLevelString()
        PUBLIC:

        Return the log level as a string value.

      • shouldLog

        boolean shouldLog​(int level)
        PUBLIC: Check if a message of the given level would actually be logged. Used when session is not available.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String message)
        PUBLIC: Log a message that does not need to be translated. This method is intended for external use when logging messages are wanted within the EclipseLink output.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String message,
                 java.lang.Object param)
        PUBLIC: Log a message with one parameter that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String category,
                 java.lang.String message,
                 java.lang.Object param)
        PUBLIC: Log a message with one parameter that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String message,
                 java.lang.Object param1,
                 java.lang.Object param2)
        PUBLIC: Log a message with two parameters that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String category,
                 java.lang.String message,
                 java.lang.Object param1,
                 java.lang.Object param2)
        PUBLIC: Log a message with two parameters that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String message,
                 java.lang.Object param1,
                 java.lang.Object param2,
                 java.lang.Object param3)
        PUBLIC: Log a message with three parameters that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String category,
                 java.lang.String message,
                 java.lang.Object param1,
                 java.lang.Object param2,
                 java.lang.Object param3)
        PUBLIC: Log a message with three parameters that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String message,
                 java.lang.Object param1,
                 java.lang.Object param2,
                 java.lang.Object param3,
                 java.lang.Object param4)
        PUBLIC: Log a message with four parameters that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String category,
                 java.lang.String message,
                 java.lang.Object param1,
                 java.lang.Object param2,
                 java.lang.Object param3,
                 java.lang.Object param4)
        PUBLIC: Log a message with four parameters that needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String message,
                 java.lang.Object[] arguments)
        PUBLIC: This method is called when the log request is from somewhere session is not available. The message needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String category,
                 java.lang.String message,
                 java.lang.Object[] arguments)
        PUBLIC: This method is called when the log request is from somewhere session is not available. The message needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String message,
                 java.lang.Object[] arguments,
                 boolean shouldTranslate)
        PUBLIC: This method is called when the log request is from somewhere session is not available. shouldTranslate flag determines if the message needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • log

        void log​(int level,
                 java.lang.String category,
                 java.lang.String message,
                 java.lang.Object[] arguments,
                 boolean shouldTranslate)
        PUBLIC: This method is called when the log request is from somewhere session is not available. shouldTranslate flag determines if the message needs to be translated.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • throwing

        void throwing​(java.lang.Throwable throwable)
        PUBLIC: This method is called when a throwable at finer level needs to be logged.
      • severe

        void severe​(java.lang.String message)
        PUBLIC: This method is called when a severe level message needs to be logged. The message will be translated
      • warning

        void warning​(java.lang.String message)
        PUBLIC: This method is called when a warning level message needs to be logged. The message will be translated
      • info

        void info​(java.lang.String message)
        PUBLIC: This method is called when a info level message needs to be logged. The message will be translated
      • config

        void config​(java.lang.String message)
        PUBLIC: This method is called when a config level message needs to be logged. The message will be translated
      • fine

        void fine​(java.lang.String message)
        PUBLIC: This method is called when a fine level message needs to be logged. The message will be translated
      • finer

        void finer​(java.lang.String message)
        PUBLIC: This method is called when a finer level message needs to be logged. The message will be translated
      • finest

        void finest​(java.lang.String message)
        PUBLIC: This method is called when a finest level message needs to be logged. The message will be translated
      • logThrowable

        void logThrowable​(int level,
                          java.lang.Throwable throwable)
        PUBLIC: Log a Throwable with level.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • logThrowable

        void logThrowable​(int level,
                          java.lang.String category,
                          java.lang.Throwable throwable)
        PUBLIC: Log a throwable with level.

        The EclipseLink logging levels available are:

        ALL  = 0
        FINEST  = 1
        FINER  = 2
        FINE  = 3
        CONFIG  = 4
        INFO  = 5
        WARNING = 6
        SEVERE  = 7
        OFF  = 8
      • getSession

        Session getSession()
        PUBLIC: Get the session that owns this SessionLog.
      • setSession

        void setSession​(Session session)
        PUBLIC: Set the session that owns this SessionLog.
      • clone

        java.lang.Object clone()
        PUBLIC: Clone the log.