Class SLF4JLogger

  • All Implemented Interfaces:
    Cloneable, org.eclipse.persistence.logging.SessionLog

    public class SLF4JLogger
    extends org.eclipse.persistence.logging.AbstractSessionLog
    EclipseLink logger bridge over SLF4J.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ECLIPSELINK_NAMESPACE
      The default session name in case there is session name is missing.
      • Fields inherited from class org.eclipse.persistence.logging.AbstractSessionLog

        CONFIG_PREFIX, CONNECTION_STRING, DATE_FORMAT_STR, dateFormat, defaultLog, FINE_PREFIX, FINER_PREFIX, FINEST_PREFIX, INFO_PREFIX, level, session, SEVERE_PREFIX, shouldDisplayData, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, THREAD_STRING, TOPLINK_PREFIX, WARNING_PREFIX, writer
      • Fields inherited from interface org.eclipse.persistence.logging.SessionLog

        ALL, ALL_LABEL, CACHE, CONFIG, CONFIG_LABEL, CONNECTION, DBWS, DDL, DMS, EJB, EVENT, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, JPA, JPARS, loggerCatagories, METADATA, METAMODEL, MISC, MONITORING, MOXY, OFF, OFF_LABEL, PROCESSOR, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SEVERE, SEVERE_LABEL, SQL, THREAD, TRANSACTION, WARNING, WARNING_LABEL, WEAVER
    • Constructor Summary

      Constructors 
      Constructor Description
      SLF4JLogger()
      Creates an instance of EclipseLink logger bridge over SLF4J
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLevel()
      Get the logging level for the default logging category.
      int getLevel​(String categoryName)
      Get the logging level for the specified logging category.
      void log​(org.eclipse.persistence.logging.SessionLogEntry logEntry)  
      void setLevel​(int level)
      Set the logging level for the default logging category.
      void setLevel​(int level, String categoryName)
      Set the logging level for the specified logging category.
      boolean shouldLog​(int level)
      Check if a message of the given level would actually be logged under logging level for the default logging category.
      boolean shouldLog​(int level, String categoryName)
      Check if a message of the given level would actually be logged under logging level for the specified logging category.
      • Methods inherited from class org.eclipse.persistence.logging.AbstractSessionLog

        clone, config, fine, finer, finest, formatMessage, getConnectionString, getDateFormat, getDateString, getDefaultLoggingLevel, getLevelString, getLog, getSession, getSessionString, getSupplementDetailString, getThreadString, getWriter, info, isOff, log, log, log, log, log, log, log, log, log, log, log, log, log, logThrowable, logThrowable, printPrefixString, setDateFormat, setLog, setSession, setShouldDisplayData, setShouldLogExceptionStackTrace, setShouldPrintConnection, setShouldPrintDate, setShouldPrintSession, setShouldPrintThread, setWriter, setWriter, severe, shouldDisplayData, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, throwing, translateLoggingLevelToString, translateStringToLoggingLevel, warning
    • Field Detail

      • ECLIPSELINK_NAMESPACE

        public static final String ECLIPSELINK_NAMESPACE
        The default session name in case there is session name is missing.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SLF4JLogger

        public SLF4JLogger()
        Creates an instance of EclipseLink logger bridge over SLF4J
    • Method Detail

      • getLevel

        public int getLevel()
        Get the logging level for the default logging category.
        Specified by:
        getLevel in interface org.eclipse.persistence.logging.SessionLog
        Overrides:
        getLevel in class org.eclipse.persistence.logging.AbstractSessionLog
        Returns:
        level Current logging level for default the default logging category.
      • getLevel

        public int getLevel​(String categoryName)
        Get the logging level for the specified logging category.
        Specified by:
        getLevel in interface org.eclipse.persistence.logging.SessionLog
        Overrides:
        getLevel in class org.eclipse.persistence.logging.AbstractSessionLog
        Parameters:
        categoryName - The String representation of an EclipseLink logging category.
        Returns:
        level Current logging level for default the default logging category.
      • setLevel

        public void setLevel​(int level)
        Set the logging level for the default logging category.
        Specified by:
        setLevel in interface org.eclipse.persistence.logging.SessionLog
        Overrides:
        setLevel in class org.eclipse.persistence.logging.AbstractSessionLog
        Parameters:
        level - The logging level to be set.
      • setLevel

        public void setLevel​(int level,
                             String categoryName)
        Set the logging level for the specified logging category.
        Specified by:
        setLevel in interface org.eclipse.persistence.logging.SessionLog
        Overrides:
        setLevel in class org.eclipse.persistence.logging.AbstractSessionLog
        Parameters:
        level - The logging level to be set.
        categoryName - The String representation of an EclipseLink logging category.
      • shouldLog

        public boolean shouldLog​(int level)
        Check if a message of the given level would actually be logged under logging level for the default logging category.
        Specified by:
        shouldLog in interface org.eclipse.persistence.logging.SessionLog
        Overrides:
        shouldLog in class org.eclipse.persistence.logging.AbstractSessionLog
        Parameters:
        level - Message logging level.
        Returns:
        Value of true if the given message logging level will be logged or false otherwise.
      • shouldLog

        public boolean shouldLog​(int level,
                                 String categoryName)
        Check if a message of the given level would actually be logged under logging level for the specified logging category.
        Specified by:
        shouldLog in interface org.eclipse.persistence.logging.SessionLog
        Overrides:
        shouldLog in class org.eclipse.persistence.logging.AbstractSessionLog
        Parameters:
        level - Message logging level.
        categoryName - The String representation of an EclipseLink logging category.
        Returns:
        Value of true if the given message logging level will be logged or false otherwise.
      • log

        public void log​(org.eclipse.persistence.logging.SessionLogEntry logEntry)
        Specified by:
        log in interface org.eclipse.persistence.logging.SessionLog
        Specified by:
        log in class org.eclipse.persistence.logging.AbstractSessionLog