FileDocCategorySizeDatePackage
ServerLog.javaAPI DocGlassfish v2 API3876Tue May 22 16:54:48 BST 2007oracle.toplink.essentials.platform.server

ServerLog

public class ServerLog extends AbstractSessionLog

Basic logging class that provides framework for integration with the application server log. This class is used when messages need to be logged through an application server, e.g. OC4J.

see
SessionLog
see
AbstractSessionLog
see
SessionLogEntry
see
Session

Fields Summary
Constructors Summary
public ServerLog()
PUBLIC:

Create and return a new ServerLog.

        super();
        setLevel(INFO);
    
Methods Summary
protected voidbasicLog(int level, java.lang.String message)

Log message to a writer by default. It needs to be overridden by the subclasses.

param
level the log request level

param
message the formatted string message

        try {
            printPrefixString(level);
            getWriter().write(message);
            getWriter().write(Helper.cr());
            getWriter().flush();
        } catch (IOException exception) {
            throw ValidationException.logIOError(exception);
        }
    
public voidlog(oracle.toplink.essentials.logging.SessionLogEntry entry)
PUBLIC:

Log a SessionLogEntry

param
entry SessionLogEntry that holds all the information for a TopLink logging event

        if (!shouldLog(entry.getLevel())) {
            return;
        }

        String message = getSupplementDetailString(entry);

        if (entry.hasException()) {
            message += entry.getException();
        } else {
            message += formatMessage(entry);
        }

        basicLog(entry.getLevel(), message);