|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.aselect.system.logging.SystemLogger
public class SystemLogger
The logger to write system log entries.
Description:
The system logger writes system log entries to a file.
Concurrency issues:
-
Constructor Summary | |
---|---|
SystemLogger()
Default constructor. |
Method Summary | |
---|---|
void |
closeHandlers()
Cleanup logger resources. |
static java.lang.String |
formatDetailedError(java.lang.String sModule,
java.lang.String sMethod,
java.lang.Exception e,
java.lang.String sErrorType)
Deprecated. use log(Level, String, String, String, Throwable) instead. |
static java.lang.String |
formatInternalError(java.lang.String sModule,
java.lang.String sMethod,
java.lang.Exception e)
Deprecated. use log(Level, String, String, String, Throwable) instead. |
void |
init(java.lang.String sLogFileNamePrefix,
java.lang.String sLoggerNamespace,
ConfigManager oConfigManager,
java.lang.Object oLogTargetConfig,
java.lang.String sWorkingDir)
Initializes the System logger. |
void |
init(java.lang.String sLogDir,
java.lang.String sLogFileNamePrefix,
java.lang.String sLoggerNamespace,
int iFileLimit,
int iNumberOfFiles)
Deprecated. use other init! Initialize the SystemLogger .
Description: Performs the following steps:
Concurrency issues: - Preconditions:
Postconditions: The logger is initialised. |
boolean |
isDebug()
|
void |
log(java.util.logging.Level level,
java.lang.String sMessage)
Write a log item. |
void |
log(java.util.logging.Level level,
java.lang.String sModule,
java.lang.String sMethod,
java.lang.String sMessage)
Write a log item with additional information. |
void |
log(java.util.logging.Level level,
java.lang.String sModule,
java.lang.String sMethod,
java.lang.String sMessage,
java.lang.Throwable cause)
Write a log item with additional information and a cause. |
void |
log(java.util.logging.Level level,
java.lang.String sMessage,
java.lang.Throwable cause)
Write a log item with a cause. |
void |
setDebug(boolean bDebug)
Deprecated. use setLevel(Level) instead. |
void |
setLevel(java.util.logging.Level oLevel)
Set the level of the system logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SystemLogger()
Method Detail |
---|
public void init(java.lang.String sLogDir, java.lang.String sLogFileNamePrefix, java.lang.String sLoggerNamespace, int iFileLimit, int iNumberOfFiles) throws java.lang.Exception
SystemLogger
.
sLogDir
- The logging directory.sLogFileNamePrefix
- The log file name prefix (".log" is appended).sLoggerNamespace
- The namespace of this system logger.iFileLimit
- The maximum number of bytes to write to any one file.iNumberOfFiles
- The number of files to use for rotation.
java.lang.Exception
- If initialisation fails.public void init(java.lang.String sLogFileNamePrefix, java.lang.String sLoggerNamespace, ConfigManager oConfigManager, java.lang.Object oLogTargetConfig, java.lang.String sWorkingDir) throws ASelectException
FileHandler
object and sets it's log level.Logger
object and sets it's log level.null
null
null
sLogFileNamePrefix
- The log file name prefix (".log" is appended).sLoggerNamespace
- The namespace of this system logger.oConfigManager
- The config manager used to retrieve the
configuration fromoLogTargetConfig
- The 'target' config section containing the file
configurationsWorkingDir
- The workingdir that must be used when no directory is
configured
ASelectException
- if initializing failed (missing config items)public void log(java.util.logging.Level level, java.lang.String sMessage)
level
- The level of the log item.sMessage
- The message to be logged.public void log(java.util.logging.Level level, java.lang.String sMessage, java.lang.Throwable cause)
level
- The level of the log item.sMessage
- The message to be logged.cause
- The Throwable
that causes this log item.public void log(java.util.logging.Level level, java.lang.String sModule, java.lang.String sMethod, java.lang.String sMessage)
level != null
sModule != null
sMethod != null
sMessage != null
level
- The log level.sModule
- The module name.sMethod
- The method name.sMessage
- The log message.public void log(java.util.logging.Level level, java.lang.String sModule, java.lang.String sMethod, java.lang.String sMessage, java.lang.Throwable cause)
level != null
sModule != null
sMethod != null
sMessage != null
cause != null
level
- The log level.sModule
- The module name.sMethod
- The method name.sMessage
- The log message.cause
- the logging cause.public void setDebug(boolean bDebug)
setLevel(Level)
instead.
bDebug
- True if debugging should be enabled, otherwise false.public void setLevel(java.util.logging.Level oLevel)
Level | Description |
---|---|
SEVERE |
highest value; severe problems |
WARNING |
warning messages |
INFO |
Information messages |
CONFIG |
Configuration messages |
FINE |
Extra information like received or sent data. |
FINER |
If this level is specified the logger will also log stacktraces if available. |
oLevel != null
Level <= FINER
bebug mode is enabled.
oLevel
- The new Level
to use.public void closeHandlers()
public boolean isDebug()
public static java.lang.String formatDetailedError(java.lang.String sModule, java.lang.String sMethod, java.lang.Exception e, java.lang.String sErrorType)
log(Level, String, String, String, Throwable)
instead.
sModule
- The module (class name) that is to be logged.sMethod
- The method that is to be logged.e
- A Exception that is to be logged.sErrorType
- The type of error.
public static java.lang.String formatInternalError(java.lang.String sModule, java.lang.String sMethod, java.lang.Exception e)
log(Level, String, String, String, Throwable)
instead.
sModule
- The module (class name) that is to be logged.sMethod
- The method that is to be logged.e
- A Exception that is to be logged.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |