ucar.util
Interface Logger

All Known Implementing Classes:
AbstractLogger, RMILogger

public interface Logger

This interface provides logging functions for daemon applications such as servers. It looks a lot like UCAR's ulog(3) C language interface, which in turn looks like the UNIX syslog(3C) client interface.

Log messages are tagged with a numeric logging level, selected from the ordered list of constants below. Higher levels are more verbose. An implementation would use the level of a message to decide where and whether to write the message.

The three lowest logging levels, EMERG, ALERT, and CRIT, should probably never be assigned by user (non-kernel or non JVM?) code.

Note: By default, the shorthand methods are silent in the face of internal exceptions.


Field Summary
static int ALERT
          Log level for messages indicating that action must be taken immediately.
static int CRIT
          Log level for messages indicating critical conditions.
static int DEBUG
          Log level for debug messages
static int EMERG
          Log level for messages indicating that the system is unusable.
static int ERR
          Log level for error messages.
static int INFO
          Log level for informational (verbose) messages.
static int NOTICE
          Log level for messages indicating a normal but significant condition.
static int WARNING
          Log level for warnings.
 
Method Summary
 void log(int level, java.lang.String message)
          Arrange to log the message at the given level.
 void logDebug(java.lang.String message)
          Shorthand for log(Logger.DEBUG, message).
 void logError(java.lang.String message)
          Shorthand for log(Logger.ERR, message).
 void logInfo(java.lang.String message)
          Shorthand for log(Logger.INFO, message).
 void logNotice(java.lang.String message)
          Shorthand for log(Logger.NOTICE, message).
 void logUpTo(int maxLevel)
          Control the verbosity of the implementation.
 

Field Detail

EMERG

static final int EMERG
Log level for messages indicating that the system is unusable. Included only for syslog compatiblity.

See Also:
Constant Field Values

ALERT

static final int ALERT
Log level for messages indicating that action must be taken immediately. Included only for syslog compatiblity.

See Also:
Constant Field Values

CRIT

static final int CRIT
Log level for messages indicating critical conditions. Included only for syslogd compatiblity.

See Also:
Constant Field Values

ERR

static final int ERR
Log level for error messages. Included only for syslog compatiblity.

See Also:
Constant Field Values

WARNING

static final int WARNING
Log level for warnings.

See Also:
Constant Field Values

NOTICE

static final int NOTICE
Log level for messages indicating a normal but significant condition.

See Also:
Constant Field Values

INFO

static final int INFO
Log level for informational (verbose) messages.

See Also:
Constant Field Values

DEBUG

static final int DEBUG
Log level for debug messages

See Also:
Constant Field Values
Method Detail

logUpTo

void logUpTo(int maxLevel)
Control the verbosity of the implementation. Messages tagged with level above maxLevel may be discarded.


log

void log(int level,
         java.lang.String message)
         throws java.io.IOException
Arrange to log the message at the given level.

Parameters:
level - Int value which is one of EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO, or DEBUG.
String - message to be logged.
Throws:
java.io.IOException

logError

void logError(java.lang.String message)
Shorthand for log(Logger.ERR, message).

See Also:
ERR, log(int, java.lang.String)

logNotice

void logNotice(java.lang.String message)
Shorthand for log(Logger.NOTICE, message).

See Also:
NOTICE, log(int, java.lang.String)

logInfo

void logInfo(java.lang.String message)
Shorthand for log(Logger.INFO, message).

See Also:
INFO, log(int, java.lang.String)

logDebug

void logDebug(java.lang.String message)
Shorthand for log(Logger.DEBUG, message).

See Also:
DEBUG, log(int, java.lang.String)