/** * 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: * <p> * Check if a message of the given level would actually be logged by the logger * with name space built from the given session and category. * Return the shouldLog for the given category from * </p><p> * @return true if the given message level will be logged * </p> */ @Override public boolean shouldLog(int level, String category) { return (getLevel(category) <= level); }
/** * Append the specified message information to the writer. */ protected void writeMessage(String message) throws IOException { this.getWriter().write(message); }
if (!shouldLog(entry.getLevel(), entry.getNameSpace())) { return; printPrefixString(entry.getLevel()); this.getWriter().write(getSupplementDetailString(entry)); entry.getException().printStackTrace(new PrintWriter(getWriter())); } else if (entry.getLevel() <= WARNING) { if (shouldLogExceptionStackTrace()) { entry.getException().printStackTrace(new PrintWriter(getWriter())); } else { writeMessage(entry.getException().toString()); writeMessage(formatMessage(entry)); getWriter().write(Helper.cr()); getWriter().flush(); } catch (IOException exception) { throw ValidationException.logIOError(exception);
((DefaultSessionLog)AbstractSessionLog.getLog()).setWriter(logWriter);
/** * PUBLIC: * Create a new default session log for the given writer. */ public DefaultSessionLog(Writer writer) { this(); this.initialize(writer); }
session.setLogLevel(logLevel); if(logWriter!=null){ ((DefaultSessionLog)session.getSessionLog()).setWriter(logWriter);
/** * PUBLIC: * <p> * Return the singleton SessionLog. If the singleton SessionLog does not exist, * a new one is created based on the version of JDK being used from the Version class. * </p><p> * * @return the singleton SessionLog * </p> */ public static SessionLog getLog() { if (defaultLog == null) { defaultLog = new DefaultSessionLog(); } return defaultLog; }
/** * Append the separator string to the writer. */ protected void writeSeparator() throws IOException { this.getWriter().write("--"); } }
/** * PUBLIC: * Return the session log to which an accessor logs messages and SQL. * If not set, this will default to a session log on a writer on System.out. */ public SessionLog getSessionLog() { if (sessionLog == null) { setSessionLog(new DefaultSessionLog()); } return sessionLog; }