Package com.isomorphic.log
Class Logger
java.lang.Object
com.isomorphic.log.Logger
Logger provides a mechanism for tracking log messages. By default Isomorphic SmartClient server-side logging is based on Apache's open source log4j API, although there is a possibility to use other logging frameworks via Quality Open Software's (QOS.ch) Simple Logging Facade for Java (slf4j) API. For more general information on log4j, see this " Short introduction to log4j" on the Apache website. For more general information on slf4j, see this "SLF4J user manual" on the QOSs.ch website. Search for "serverLogging" in SmartClient Reference for information on how to switch between logging frameworks. The logging priorities used in the Isomorphic SmartClient framework are:
fatal--unrecoverable error, the program will probably crash (if slf4j is used, then this will also useerrorpriority, as slf4j does not supportfatalpriority)error--recoverable error, the program may become unstablewarning--unusual data or a risky operation is about to be attemptedinfo--interesting events worth notingdebug--any message that aids in debugging to track system progress
The methods in the Logger class can be used to log debug, warning, or error messages from classes running in the Isomorphic SmartClient environment. To create a new logger to track messages by class name, place the following line of code at the top of the class definition:
private static Logger log = new Logger(myClass.class.getName());
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidLogs a message with "debug" status.voidLogs a message with "error" status.voidLogs a message with "fatal" status.voidLogs a message with "info" status.booleanChecks if the logger has been enabled to allowdebugmessages.booleanChecks if the logger has been enabled to allowerrormessages.booleanChecks if the logger has been enabled to allowfatalmessages.booleanChecks if the logger has been enabled to allowinfomessages.booleanChecks if the logger has been enabled to allowwarningmessages.voidLogs a message with "warning" status.
-
Constructor Details
-
Logger
ConstructsLoggerobject using className of providedClassas logging category. -
Logger
ConstructsLoggerobject using providedsubsystemas logging category.
-
-
Method Details
-
fatal
Logs a message with "fatal" status.- Parameters:
message- the message to log
-
error
Logs a message with "error" status.- Parameters:
message- the message to log
-
warning
Logs a message with "warning" status.- Parameters:
message- the message to log
-
info
Logs a message with "info" status.- Parameters:
message- the message to log
-
debug
Logs a message with "debug" status.- Parameters:
message- the message to log
-
isFatalEnabled
public boolean isFatalEnabled()Checks if the logger has been enabled to allowfatalmessages.- Returns:
trueif enabled, andfalseotherwise
-
isDebugEnabled
public boolean isDebugEnabled()Checks if the logger has been enabled to allowdebugmessages.- Returns:
trueif enabled, andfalseotherwise
-
isInfoEnabled
public boolean isInfoEnabled()Checks if the logger has been enabled to allowinfomessages.- Returns:
trueif enabled, andfalseotherwise
-
isWarnEnabled
public boolean isWarnEnabled()Checks if the logger has been enabled to allowwarningmessages.- Returns:
trueif enabled, andfalseotherwise
-
isErrorEnabled
public boolean isErrorEnabled()Checks if the logger has been enabled to allowerrormessages.- Returns:
trueif enabled, andfalseotherwise
-