Class SysLogger
java.lang.Object
org.silverpeas.kernel.logging.sys.SysLogger
- All Implemented Interfaces:
SilverLogger
This logger implementation uses the Java logging system to write actually the messages into logs.
- Author:
- mmoquillon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidLogs an debugging message with the specified parameters.getLevel()Gets the log Level of this Logger.Gets the namespace of this logger.booleanisLoggable(Level level) Checks if a message of the given level would actually be logged by this logger.voidLogs a message at the specified level, with the specified parameters if any.voidLogs a message at the specified level, with the specified parameters if any and with a Throwable object if any.voidSets the log level specifying which message levels will be logged by this logger.
-
Constructor Details
-
SysLogger
-
-
Method Details
-
getNamespace
Gets the namespace of this logger. Each logger is defined by a unique dot separated namespace.- Specified by:
getNamespacein interfaceSilverLogger- Returns:
- the namespace of this logger.
-
getLevel
Gets the log Level of this Logger. If no level was explicitly set for his logger, its effective level is then inherited from its parent.- Specified by:
getLevelin interfaceSilverLogger- Returns:
- the level of this logger.
-
setLevel
Sets the log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded. If the new level is null, it means that this node should inherit its level from its nearest ancestor with a specific (non-null) level value.- Specified by:
setLevelin interfaceSilverLogger- Parameters:
level- the new value for the log level (may be null).
-
isLoggable
Checks if a message of the given level would actually be logged by this logger. This check is based on the Loggers effective level, which may be inherited from its parent.- Specified by:
isLoggablein interfaceSilverLogger- Parameters:
level- a logging level.- Returns:
- true if a message of the given level would actually be logged. False otherwise.
-
log
Logs a message at the specified level, with the specified parameters if any and with a Throwable object if any. If the logger is currently enabled for the given message level then a corresponding logging record is created and forwarded to all the registered output handlers objects.- Specified by:
login interfaceSilverLogger- Parameters:
level- the level of the message to log.message- the message to log.parameters- zero, one or more parameters to the message. Shouldn't be null.error- an error to log with the message.
-
log
Logs a message at the specified level, with the specified parameters if any.- Specified by:
login interfaceSilverLogger- Parameters:
level- the level of the message to log.message- the message to log.parameters- zero, one or more parameters to the message.
-
debug
Logs an debugging message with the specified parameters. The message is computed by a function that will be invoked only if the actual logger level is higher or equal than the message level. Usually, debugging message are computed by executing codes that shouldn't be ran in a nominal execution context. In order to avoid this code to be executed when the logger level is lower than the debug level, it can be written within a function whose the invocation is left to the logger responsibility.- Specified by:
debugin interfaceSilverLogger- Parameters:
messageSupplier- a function that will computed the message to log.
-