public final class IfsLogger extends Object
java.util.logging
.Modifier and Type | Method and Description |
---|---|
void |
addHandler(Handler handler)
Add a log Handler to receive logging messages.
|
void |
clearEffectiveLevel()
Clear the effective level of this Logger.
|
Level |
getEffectiveLevel()
Get the effective level of this Logger.
|
Filter |
getFilter()
Get the current filter for this Logger.
|
Handler[] |
getHandlers()
Get the Handlers associated with this logger.
|
static boolean |
getIncludeMethodColumns()
Gets indication as to whether method name and line numbers are
to be included in log records.
|
Level |
getLevel()
Get the log Level that has been specified for this Logger.
|
static IfsLogger |
getLogger()
Factory method to get an instance of this class, uses introspection
to determine the name of he calling class, and that is used as
the logger name.
|
static IfsLogger |
getLogger(String loggerName)
Factory method to get an instance of this class.
|
String |
getName()
Get the name for this logger.
|
IfsLogger |
getParent()
Return the parent for this Logger.
|
static IfsLogger |
getRootLogger()
Gets the root Logger.
|
boolean |
isLoggable(Level level)
Check if a log request of the given level would actually be logged
by this logger.
|
void |
log(IfsLogRecord record)
Overwrite base log method to not count this class as a caller when determining
calling class and method.
|
void |
log(Level level,
LogInfo logInfo,
String msg)
Log a message with extra IFS info.
|
void |
log(Level level,
LogInfo logInfo,
String msg,
Object arg1)
Log a message with IFS extra logging info, and with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
LogInfo logInfo,
String msg,
Object arg1,
Object arg2)
Log a message with IFS extra logging info, and with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
LogInfo logInfo,
String msg,
Object arg1,
Object arg2,
Object arg3)
Log a message with IFS extra logging info, and with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
LogInfo logInfo,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Log a message with IFS extra logging info, and with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
LogInfo logInfo,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
Log a message with IFS extra logging info, and with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
LogInfo logInfo,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
Log a message with IFS extra logging info, and with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
LogInfo logInfo,
String msg,
Throwable thrown)
Log a message with a throwable and extra IFS logging information.
|
void |
log(Level level,
String msg)
Log a message without IFS extra logging info.
|
void |
log(Level level,
String msg,
Object arg1)
Log a message without IFS extra logging info, with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
String msg,
Object arg1,
Object arg2)
Log a message without IFS extra logging info, with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3)
Log a message without IFS extra logging info, with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Log a message without IFS extra logging info, with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
Log a message without IFS extra logging info, with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
Log a message without IFS extra logging info, with additional arguments
to be concatenated to the log message.
|
void |
log(Level level,
String msg,
Throwable thrown)
Log a message with a throwable, essentially a wrapper method to Logger.
|
static void |
registerLogInfoProvider(LogInfoProvider provider)
Register a LogInfoProvider that can get a LogInfo object during a
log request.
|
void |
removeHandler(Handler handler)
Remove a log Handler.
|
void |
setFilter(Filter filter)
Set a filter to control output on this Logger.
|
static void |
setIncludeMethodColumns(boolean verbose)
Sets indication as to whether method name and line numbers are
to be included in log records.
|
void |
setUseParentHandlers(boolean useParentHandlers)
Specify whether or not this logger should send its output
to its parent Logger.
|
public static void setIncludeMethodColumns(boolean verbose)
verbose
- whether method name and line numbers are
to be included in log records.public static boolean getIncludeMethodColumns()
public static void registerLogInfoProvider(LogInfoProvider provider)
provider
- the default LogInfoProviderpublic static IfsLogger getLogger()
public static IfsLogger getRootLogger()
public static IfsLogger getLogger(String loggerName)
loggerName
- A String containing the name fo the logger to return.
Will return an existing logger or create a new logger.
Normal usaage is to use the classname of the logger.public void log(Level level, String msg)
level
- a Level object that determines the log
level of this request.msg
- a String containing the message to log.public void log(Level level, String msg, Object arg1)
level
- a Level object that determines the log
level of this request.msg
- a String containing the message to log.arg1
- first logging argument.public void log(Level level, String msg, Object arg1, Object arg2)
level
- a Level object that determines the log
level of this request.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.public void log(Level level, String msg, Object arg1, Object arg2, Object arg3)
level
- a Level object that determines the log
level of this request.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.public void log(Level level, String msg, Object arg1, Object arg2, Object arg3, Object arg4)
level
- a Level object that determines the log
level of this request.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.arg4
- fourth logging argument.public void log(Level level, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
level
- a Level object that determines the log
level of this request.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.arg4
- fourth logging argument.arg5
- fifth logging argument.public void log(Level level, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
level
- a Level object that determines the log
level of this request.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.arg4
- fourth logging argument.arg5
- fifth logging argument.arg6
- sixth logging argument.public void log(Level level, String msg, Throwable thrown)
level
- a Level object that determines the log level
of this request.msg
- a String containing the message to log.thrown
- a Throwable to log.public void log(Level level, LogInfo logInfo, String msg)
level
- a Level object that determines the log level
of this requestlogInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to logpublic void log(Level level, LogInfo logInfo, String msg, Object arg1)
level
- a Level object that determines the log
level of this request.logInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to log.arg1
- first logging argument.public void log(Level level, LogInfo logInfo, String msg, Object arg1, Object arg2)
level
- a Level object that determines the log
level of this request.logInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.public void log(Level level, LogInfo logInfo, String msg, Object arg1, Object arg2, Object arg3)
level
- a Level object that determines the log
level of this request.logInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.public void log(Level level, LogInfo logInfo, String msg, Object arg1, Object arg2, Object arg3, Object arg4)
level
- a Level object that determines the log
level of this request.logInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.arg4
- fourth logging argument.public void log(Level level, LogInfo logInfo, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
level
- a Level object that determines the log
level of this request.logInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.arg4
- fourth logging argument.arg5
- fifth logging argument.public void log(Level level, LogInfo logInfo, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
level
- a Level object that determines the log
level of this request.logInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to log.arg1
- first logging argument.arg2
- second logging argument.arg3
- third logging argument.arg4
- fourth logging argument.arg5
- fifth logging argument.arg6
- sixth logging argument.public void log(Level level, LogInfo logInfo, String msg, Throwable thrown)
level
- a Level object that determines the log level
of this requestlogInfo
- a object that implements LogInfo that contains
extra information to log.msg
- a String containing the message to logthrown
- a Throwable to logpublic void log(IfsLogRecord record)
record
- the LogRecord to be publishedpublic Level getEffectiveLevel()
If not cached, delegate request to the IfsLogManager, which will choose the closest explicitly set log level, using the root logger's level as a last resort.
public void clearEffectiveLevel()
public Level getLevel()
public boolean isLoggable(Level level)
level
- a message logging level, may not be nullpublic void addHandler(Handler handler) throws SecurityException
By default, Loggers also send their output to their parent logger. Typically the root Logger is configured with a set of Handlers that essentially act as default handlers for all loggers.
handler
- a logging HandlerSecurityException
- if a security manager exists and if the caller
does not have LoggingPermission("control").public Filter getFilter()
public Handler[] getHandlers()
public String getName()
public IfsLogger getParent()
This method returns the nearest parent in the namespace. Thus if a Logger is called "a.b.c.d", and a Logger called "a.b" has been created but no logger "a.b.c" exists, then a call of getParent on the Logger "a.b.c.d" will return the Logger "a.b".
The result will be null if it is called on the root Logger in the namespace.
public void removeHandler(Handler handler) throws SecurityException
Returns silently if the given Handler is not found.
handler
- a logging HandlerSecurityException
- if a security manager exists and if the caller
does not have LoggingPermission("control").public void setFilter(Filter filter) throws SecurityException
After passing the initial "level" check, the Logger will call this Filter to check if a log record should really be published.
filter
- a filter object (may be null)SecurityException
- if a security manager exists and if the caller
does not have LoggingPermission("control").public void setUseParentHandlers(boolean useParentHandlers)
useParentHandlers
- true if output is to be sent to the
logger's parent.Copyright © 2023. All rights reserved.