public class Slf4jSessionLogger
extends org.eclipse.persistence.logging.AbstractSessionLog
This is a wrapper class for SLF4J. It is used when messages need to be logged through SLF4J.
Para usar SLF4j para los logs de EclipseLink configuramos la propiedad
eclipselink.logging.logger con el valor
org.eclipse.persistence.logging.Slf4jSessionLogger
La configuración del nivel de los logs no se realiza en EclipseLink (con la propiedad eclipselink.logging.level), sino en la implementación de SLF4J.
Se puede usar el resto de las propiedades de logging de EclipseLink (eclipselink.logging.timestamp, eclipselink.logging.thread, eclipselink.logging.session, eclipselink.logging.connection y eclipselink.logging.parameters) para configurar el formato de salida.
Se usan las siguientes categorias de log:
Los niveles de log de EclipseLink y SLF4J son distintos, se realiza la siguiente correspondencia:
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CATEGORY |
static String |
DEFAULT_ECLIPSELINK_NAMESPACE |
static String |
ECLIPSELINK_NAMESPACE |
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, writerALL, ALL_LABEL, CACHE, CONFIG, CONFIG_LABEL, CONNECTION, DBWS, DDL, DMS, EJB, EJB_OR_METADATA, EVENT, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, JPA, JPARS, loggerCatagories, METADATA, METAMODEL, MISC, MONITORING, MOXY, OFF, OFF_LABEL, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SEVERE, SEVERE_LABEL, SQL, TRANSACTION, WARNING, WARNING_LABEL, WEAVER| Constructor and Description |
|---|
Slf4jSessionLogger() |
| Modifier and Type | Method and Description |
|---|---|
void |
log(org.eclipse.persistence.logging.SessionLogEntry entry) |
boolean |
shouldDisplayData()
Return true if SQL logging should log visible bind parameters.
|
boolean |
shouldLog(int level) |
boolean |
shouldLog(int level,
String category) |
clone, config, fine, finer, finest, formatMessage, getConnectionString, getDateFormat, getDateString, getDefaultLoggingLevel, getLevel, getLevel, 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, setLevel, setLevel, setLog, setSession, setShouldDisplayData, setShouldLogExceptionStackTrace, setShouldPrintConnection, setShouldPrintDate, setShouldPrintSession, setShouldPrintThread, setWriter, setWriter, severe, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, throwing, translateLoggingLevelToString, translateStringToLoggingLevel, warningpublic static final String ECLIPSELINK_NAMESPACE
public static final String DEFAULT_CATEGORY
public static final String DEFAULT_ECLIPSELINK_NAMESPACE
public void log(org.eclipse.persistence.logging.SessionLogEntry entry)
log in interface org.eclipse.persistence.logging.SessionLoglog in class org.eclipse.persistence.logging.AbstractSessionLogpublic boolean shouldLog(int level,
String category)
shouldLog in interface org.eclipse.persistence.logging.SessionLogshouldLog in class org.eclipse.persistence.logging.AbstractSessionLogpublic boolean shouldLog(int level)
shouldLog in interface org.eclipse.persistence.logging.SessionLogshouldLog in class org.eclipse.persistence.logging.AbstractSessionLogpublic boolean shouldDisplayData()
shouldDisplayData in interface org.eclipse.persistence.logging.SessionLogshouldDisplayData in class org.eclipse.persistence.logging.AbstractSessionLogCopyright © 2019. All rights reserved.