/** * PUBLIC: * Return if the log entry was for an exception. */ public boolean hasException() { return getException() != null; }
entry.getException().printStackTrace(new PrintWriter(getWriter())); } else if (entry.getLevel() <= WARNING) { if (shouldLogExceptionStackTrace()) { entry.getException().printStackTrace(new PrintWriter(getWriter())); } else { writeMessage(entry.getException().toString());
/** * 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())) { return; } String message = getSupplementDetailString(entry); if (entry.hasException()) { message += entry.getException(); } else { message += formatMessage(entry); } basicLog(entry.getLevel(), message); }
/** * 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); }