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 useerror
priority, as slf4j does not supportfatal
priority)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 TypeMethodDescriptionvoid
Logs a message with "debug
" status.void
Logs a message with "error
" status.void
Logs a message with "fatal
" status.void
Logs a message with "info
" status.boolean
Checks if the logger has been enabled to allowdebug
messages.boolean
Checks if the logger has been enabled to allowerror
messages.boolean
Checks if the logger has been enabled to allowfatal
messages.boolean
Checks if the logger has been enabled to allowinfo
messages.boolean
Checks if the logger has been enabled to allowwarning
messages.void
Logs a message with "warning
" status.
-
Constructor Details
-
Logger
ConstructsLogger
object using className of providedClass
as logging category. -
Logger
ConstructsLogger
object using providedsubsystem
as 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 allowfatal
messages.- Returns:
true
if enabled, andfalse
otherwise
-
isDebugEnabled
public boolean isDebugEnabled()Checks if the logger has been enabled to allowdebug
messages.- Returns:
true
if enabled, andfalse
otherwise
-
isInfoEnabled
public boolean isInfoEnabled()Checks if the logger has been enabled to allowinfo
messages.- Returns:
true
if enabled, andfalse
otherwise
-
isWarnEnabled
public boolean isWarnEnabled()Checks if the logger has been enabled to allowwarning
messages.- Returns:
true
if enabled, andfalse
otherwise
-
isErrorEnabled
public boolean isErrorEnabled()Checks if the logger has been enabled to allowerror
messages.- Returns:
true
if enabled, andfalse
otherwise
-