/** * INTERNAL: * Log exceptions to the default log then throw them. */ private void logAndThrowException(int level, RuntimeException exception) throws RuntimeException { AbstractSessionLog.getLog().logThrowable(level, exception); throw exception; }
/** * PUBLIC: * Create a new default session log for the given writer. */ public DefaultSessionLog(Writer writer) { this(); this.initialize(writer); }
/** * PUBLIC: * Return if the log entry was for an exception. */ public boolean hasException() { return getException() != null; }
/** * 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); } }
/** * PUBLIC: * <p> * Log a throwable at FINER level. * </p><p> * * @param throwable a Throwable * </p> */ public void throwing(Throwable throwable) { if (shouldLog(FINER)) { SessionLogEntry entry = new SessionLogEntry(null, throwable); entry.setLevel(FINER); log(entry); } }
/** * INTERNAL: * Get the singleton entityContainer. * @return EnityContainer */ public static synchronized JavaSECMPInitializer getJavaSECMPInitializer() { if (javaSECMPInitializer == null) { javaSECMPInitializer = new JavaSECMPInitializer(); } AbstractSessionLog.getLog().setLevel(JavaSECMPInitializer.getTopLinkLoggingLevel()); return javaSECMPInitializer; }
/** * PUBLIC: * <p> * This method is called when a warning level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void warning(String message) { log(WARNING, message, (Object[])null); }
/** * INTERNAL: getServerLog(): Return the ServerLog for this platform * * Return JavaLog for Oc4jPlatform * * @return oracle.toplink.essentials.logging.SessionLog */ //Bug5389724 public SessionLog getServerLog() { return new JavaLog(); } }
/** * PUBLIC: * <p> * Return the log level. It is used when session is not available. * </p><p> * * @return the log level * </p> */ public int getLevel() { return getLevel(null); }
/** * PUBLIC: * <p> * Set the log level. It is used when session is not available. * </p><p> * * @param level the new log level * </p> */ public void setLevel(int level) { setLevel(level, null); }
/** * INTERNAL: getServerLog(): Return the ServerLog for this platform * * Return the default ServerLog in the base * * @return oracle.toplink.essentials.logging.SessionLog */ public oracle.toplink.essentials.logging.SessionLog getServerLog() { return new DefaultSessionLog(); }
/** * PUBLIC: * Return the date format to be used when printing a log entry date. * @return the date format */ public DateFormat getDateFormat() { if (dateFormat == null) { dateFormat = this.buildDefaultDateFormat(); } return dateFormat; }
/** * PUBLIC: * <p> * Set the singleton SessionLog. * </p> * * @param sessionLog a SessionLog * </p> */ public static void setLog(SessionLog sessionLog) { defaultLog = sessionLog; defaultLog.setSession(null); }
/** * PUBLIC: * <p> * This method is called when a config level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void config(String message) { log(CONFIG, message, (Object[])null); }
public SessionLog getServerLog() { return new JavaLog(); } }
/** * PUBLIC: * <p> * This method is called when a info level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void info(String message) { log(INFO, message, (Object[])null); }
/** * PUBLIC: * <p> * This method is called when a finer level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void finer(String message) { log(FINER, message, (Object[])null); }
/** * PUBLIC: * <p> * This method is called when a finest level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void finest(String message) { log(FINEST, message, (Object[])null); }
/** * PUBLIC: * <p> * This method is called when a fine level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void fine(String message) { log(FINE, message, (Object[])null); }