/** * PUBLIC: * <p> * Log a SessionLogEntry * </p><p> * @param entry SessionLogEntry that holds all the information for a TopLink logging event * </p> */ public void log(SessionLogEntry entry) { if (!shouldLog(entry.getLevel(), entry.getNameSpace())) { return; } Logger logger = getLogger(entry.getNameSpace()); Level javaLevel = getJavaLevel(entry.getLevel()); internalLog(entry, javaLevel, logger); }
/** * PUBLIC: * Log the log entry. */ public void log(SessionLogEntry entry) { if (shouldLog(entry.getLevel(), entry.getNameSpace())) { if (entry.getSession() == null) {// Used for proxy session. entry.setSession(this); } getSessionLog().log(entry); } }
if (!shouldLog(entry.getLevel(), entry.getNameSpace())) { return;
/** * INTERNAL: * <p> * Build a LogRecord * </p><p> * @param entry SessionLogEntry that holds all the information for a TopLink logging event * @param javaLevel the message level * </p> */ protected void internalLog(SessionLogEntry entry, Level javaLevel, Logger logger) { // Format message so that we do not depend on the bundle TopLinkLogRecord lr = new TopLinkLogRecord(javaLevel, formatMessage(entry)); lr.setSourceClassName(null); lr.setSourceMethodName(null); lr.setLoggerName(getNameSpaceString(entry.getNameSpace())); if (shouldPrintSession()) { lr.setSessionString(getSessionString(entry.getSession())); } if (shouldPrintConnection()) { lr.setConnection(entry.getConnection()); } lr.setThrown(entry.getException()); lr.setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace()); lr.setShouldPrintDate(shouldPrintDate()); lr.setShouldPrintThread(shouldPrintThread()); logger.log(lr); }