Interface SessionLog

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AbstractSessionLog, DefaultSessionLog, JavaLog, ServerLog, SLF4JLogger

public interface SessionLog extends Cloneable
SessionLog is the ever-so-simple interface used by EclipseLink to log generated messages and SQL. An implementor of this interface can be passed to the EclipseLink session (via the #setSessionLog(SessionLog) method); and all logging data will be passed through to the implementor via an instance of SessionLogEntry. This can be used to supplement debugging; or the entries could be stored in a database instead of logged to System.out, etc.

This class defines EclipseLink logging levels (that are used throughout EclipseLink code) with the following integer values:

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

In addition, EclipseLink categories used for logging name space are defined with the following String values:

Logging categories
 CACHE  = "cache"
 CONNECTION  = "connection"
 DMS  = "dms"
 EJB  = "ejb"
 EVENT  = "event"
 DBWS  = "dbws"
 JPARS  = "jpars"
 METADATA  = "metadata"
 METAMODEL  = "metamodel"
 MOXY  = "moxy"
 PROCESSOR  = "processor"
 PROPAGATION  = "propagation"
 PROPERTIES  = "properties"
 QUERY  = "query"
 SEQUENCING  = "sequencing"
 SERVER  = "server"
 SQL  = "sql"
 THREAD  = "thread"
 TRANSACTION  = "transaction"
 WEAVER  = "weaver"
Since:
TOPLink/Java 3.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final String
     
    static final String
     
    static final int
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final int
     
    static final String
     
    static final int
     
    static final String
     
    static final int
     
    static final String
     
    static final int
     
    static final String
     
    static final String
     
    static final String
     
    static final String[]
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final int
     
    static final String
     
    static final String
    ModelGen logging name space.
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final int
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final int
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    PUBLIC: Clone the log.
    void
    config(String message)
    PUBLIC: This method is called when a config level message needs to be logged.
    void
    fine(String message)
    PUBLIC: This method is called when a fine level message needs to be logged.
    void
    finer(String message)
    PUBLIC: This method is called when a finer level message needs to be logged.
    void
    finest(String message)
    PUBLIC: This method is called when a finest level message needs to be logged.
    int
    PUBLIC: Return the log level.
    int
    getLevel(String category)
    PUBLIC: Return the log level; category is only needed where name space is available.
    PUBLIC:
    PUBLIC: Get the session that owns this SessionLog.
    PUBLIC: Return the writer to which an accessor writes logged messages and SQL.
    void
    info(String message)
    PUBLIC: This method is called when a info level message needs to be logged.
    void
    log(int level, String message)
    PUBLIC: Log a message that does not need to be translated.
    void
    log(int level, String message, Object param)
    PUBLIC: Log a message with one parameter that needs to be translated.
    void
    log(int level, String message, Object[] arguments)
    PUBLIC: This method is called when the log request is from somewhere session is not available.
    void
    log(int level, String message, Object[] arguments, boolean shouldTranslate)
    PUBLIC: This method is called when the log request is from somewhere session is not available.
    void
    log(int level, String message, Object param1, Object param2)
    PUBLIC: Log a message with two parameters that needs to be translated.
    void
    log(int level, String message, Object param1, Object param2, Object param3)
    PUBLIC: Log a message with three parameters that needs to be translated.
    void
    log(int level, String message, Object param1, Object param2, Object param3, Object param4)
    PUBLIC: Log a message with four parameters that needs to be translated.
    void
    log(int level, String category, String message, Object param)
    PUBLIC: Log a message with one parameter that needs to be translated.
    void
    log(int level, String category, String message, Object[] arguments)
    PUBLIC: This method is called when the log request is from somewhere session is not available.
    void
    log(int level, String category, String message, Object[] arguments, boolean shouldTranslate)
    PUBLIC: This method is called when the log request is from somewhere session is not available.
    void
    log(int level, String category, String message, Object param1, Object param2)
    PUBLIC: Log a message with two parameters that needs to be translated.
    void
    log(int level, String category, String message, Object param1, Object param2, Object param3)
    PUBLIC: Log a message with three parameters that needs to be translated.
    void
    log(int level, String category, String message, Object param1, Object param2, Object param3, Object param4)
    PUBLIC: Log a message with four parameters that needs to be translated.
    void
    PUBLIC: EclipseLink will call this method whenever something needs to be logged (messages, SQL, etc.).
    void
    logThrowable(int level, String category, Throwable throwable)
    PUBLIC: Log a throwable with level.
    void
    logThrowable(int level, Throwable throwable)
    PUBLIC: Log a Throwable with level.
    void
    setLevel(int level)
    PUBLIC: Set the log level.
    void
    setLevel(int level, String category)
    PUBLIC: Set the log level.
    void
    PUBLIC: Set the session that owns this SessionLog.
    void
    setShouldDisplayData(Boolean shouldDisplayData)
    Set whether bind parameters should be displayed when logging SQL.
    void
    By default stack trace is logged for SEVERE all the time and at FINER level for WARNING or less.
    void
    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
    PUBLIC: Set the writer to which an accessor writes logged messages and SQL.
    void
    severe(String message)
    PUBLIC: This method is called when a severe level message needs to be logged.
    boolean
    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, String category)
    PUBLIC: Check if a message of the given level would actually be logged.
    boolean
    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
    By default the connection is always printed whenever available, this can be turned off.
    boolean
    By default the date is always printed, this can be turned off.
    boolean
    By default the Session is always printed whenever available, this can be turned off.
    boolean
    By default the thread is logged at FINE or less level, this can be turned off.
    void
    throwing(Throwable throwable)
    PUBLIC: This method is called when a throwable at finer level needs to be logged.
    void
    warning(String message)
    PUBLIC: This method is called when a warning level message needs to be logged.