|
JBoss Log Manager 1.2.0.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.logging.Logger
org.jboss.logmanager.Logger
public final class Logger
An actual logger instance. This is the end-user interface into the logging system.
Nested Class Summary | |
---|---|
static class |
Logger.AttachmentKey<V>
An attachment key instance. |
Field Summary |
---|
Fields inherited from class java.util.logging.Logger |
---|
global, GLOBAL_LOGGER_NAME |
Method Summary | ||
---|---|---|
void |
addHandler(Handler handler)
|
|
|
attach(Logger.AttachmentKey<V> key,
V value)
Attach an object to this logger under a given key. |
|
|
attachIfAbsent(Logger.AttachmentKey<V> key,
V value)
Attach an object to this logger under a given key, if such an attachment does not already exist. |
|
Handler[] |
clearHandlers()
A convenience method to atomically get and clear all handlers. |
|
void |
config(String msg)
|
|
|
detach(Logger.AttachmentKey<V> key)
Remove an attachment. |
|
void |
entering(String sourceClass,
String sourceMethod)
|
|
void |
entering(String sourceClass,
String sourceMethod,
Object param1)
|
|
void |
entering(String sourceClass,
String sourceMethod,
Object[] params)
|
|
void |
exiting(String sourceClass,
String sourceMethod)
|
|
void |
exiting(String sourceClass,
String sourceMethod,
Object result)
|
|
void |
fine(String msg)
|
|
void |
finer(String msg)
|
|
void |
finest(String msg)
|
|
|
getAttachment(Logger.AttachmentKey<V> key)
Get the attachment value for a given key, or null if there is no such attachment. |
|
int |
getEffectiveLevel()
Get the effective numerical log level, inherited from the parent. |
|
Filter |
getFilter()
|
|
Handler[] |
getHandlers()
|
|
Level |
getLevel()
|
|
static Logger |
getLogger(String name)
Static logger factory method which returns a JBoss LogManager logger. |
|
static Logger |
getLogger(String name,
String bundleName)
Static logger factory method which returns a JBoss LogManager logger. |
|
Logger |
getParent()
|
|
boolean |
getUseParentHandlers()
|
|
void |
info(String msg)
|
|
boolean |
isLoggable(Level level)
|
|
void |
log(Level level,
String msg)
|
|
void |
log(Level level,
String msg,
Object param1)
|
|
void |
log(Level level,
String msg,
Object[] params)
|
|
void |
log(Level level,
String msg,
Throwable thrown)
|
|
void |
log(LogRecord record)
|
|
void |
log(String fqcn,
Level level,
String message,
ExtLogRecord.FormatStyle style,
Object[] params,
Throwable t)
SPI interface method to log a message at a given level. |
|
void |
log(String fqcn,
Level level,
String message,
String bundleName,
ExtLogRecord.FormatStyle style,
Object[] params,
Throwable t)
SPI interface method to log a message at a given level, with a specific resource bundle. |
|
void |
log(String fqcn,
Level level,
String message,
Throwable t)
SPI interface method to log a message at a given level. |
|
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg)
|
|
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg,
Object param1)
|
|
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg,
Object[] params)
|
|
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg,
Throwable thrown)
|
|
void |
logRaw(ExtLogRecord record)
Do the logging with no level checks (they've already been done). |
|
void |
logRaw(LogRecord record)
Do the logging with no level checks (they've already been done). |
|
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg)
|
|
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg,
Object param1)
|
|
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg,
Object[] params)
|
|
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg,
Throwable thrown)
|
|
void |
removeHandler(Handler handler)
|
|
void |
setFilter(Filter filter)
|
|
void |
setLevel(Level newLevel)
This implementation grabs a lock, so that only one thread may update the log level of any logger at a time, in order to allow readers to never block (though there is a window where retrieving the log level reflects an older effective level than the actual level). |
|
void |
setLevelName(String newLevelName)
Set the log level by name. |
|
void |
setParent(Logger parent)
Not allowed. This method may never be called. |
|
void |
setUseParentHandlers(boolean useParentHandlers)
|
|
void |
severe(String msg)
|
|
void |
throwing(String sourceClass,
String sourceMethod,
Throwable thrown)
|
|
String |
toString()
|
|
void |
warning(String msg)
|
|
protected Object |
writeReplace()
|
Methods inherited from class java.util.logging.Logger |
---|
getAnonymousLogger, getAnonymousLogger, getName, getResourceBundle, getResourceBundleName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Logger getLogger(String name)
name
- the logger name
public static Logger getLogger(String name, String bundleName)
name
- the logger namebundleName
- the bundle name
protected final Object writeReplace() throws ObjectStreamException
ObjectStreamException
public void setFilter(Filter filter) throws SecurityException
setFilter
in class Logger
SecurityException
public Filter getFilter()
getFilter
in class Logger
public void setLevel(Level newLevel) throws SecurityException
setLevel
in class Logger
SecurityException
public void setLevelName(String newLevelName) throws SecurityException
setLevel(Level)
.
newLevelName
- the name of the level to set
SecurityException
- if a security manager exists and if the caller does not have LoggingPermission("control")public int getEffectiveLevel()
public Level getLevel()
getLevel
in class Logger
public boolean isLoggable(Level level)
isLoggable
in class Logger
public <V> V getAttachment(Logger.AttachmentKey<V> key)
null
if there is no such attachment.
V
- the attachment value typekey
- the key
null
if there is none for this keypublic <V> V attach(Logger.AttachmentKey<V> key, V value) throws SecurityException
V
- the attachment value typekey
- the attachment keyvalue
- the attachment value
SecurityException
- if a security manager exists and if the caller does not have LoggingPermission(control)
public <V> V attachIfAbsent(Logger.AttachmentKey<V> key, V value) throws SecurityException
V
- the attachment value typekey
- the attachment keyvalue
- the attachment value
null
if the value was successfully attached
SecurityException
- if a security manager exists and if the caller does not have LoggingPermission(control)
public <V> V detach(Logger.AttachmentKey<V> key) throws SecurityException
V
- the attachment value typekey
- the attachment key
null
if there was none
SecurityException
- if a security manager exists and if the caller does not have LoggingPermission(control)
public void addHandler(Handler handler) throws SecurityException
addHandler
in class Logger
SecurityException
public void removeHandler(Handler handler) throws SecurityException
removeHandler
in class Logger
SecurityException
public Handler[] getHandlers()
getHandlers
in class Logger
public Handler[] clearHandlers() throws SecurityException
SecurityException
- if a security manager exists and if the caller does not have LoggingPermission(control)
public void setUseParentHandlers(boolean useParentHandlers)
setUseParentHandlers
in class Logger
public boolean getUseParentHandlers()
getUseParentHandlers
in class Logger
public Logger getParent()
getParent
in class Logger
public void setParent(Logger parent)
setParent
in class Logger
SecurityException
- alwayspublic void log(LogRecord record)
log
in class Logger
public void entering(String sourceClass, String sourceMethod)
entering
in class Logger
public void entering(String sourceClass, String sourceMethod, Object param1)
entering
in class Logger
public void entering(String sourceClass, String sourceMethod, Object[] params)
entering
in class Logger
public void exiting(String sourceClass, String sourceMethod)
exiting
in class Logger
public void exiting(String sourceClass, String sourceMethod, Object result)
exiting
in class Logger
public void throwing(String sourceClass, String sourceMethod, Throwable thrown)
throwing
in class Logger
public void severe(String msg)
severe
in class Logger
public void warning(String msg)
warning
in class Logger
public void info(String msg)
info
in class Logger
public void config(String msg)
config
in class Logger
public void fine(String msg)
fine
in class Logger
public void finer(String msg)
finer
in class Logger
public void finest(String msg)
finest
in class Logger
public void log(Level level, String msg)
log
in class Logger
public void log(Level level, String msg, Object param1)
log
in class Logger
public void log(Level level, String msg, Object[] params)
log
in class Logger
public void log(Level level, String msg, Throwable thrown)
log
in class Logger
public void logp(Level level, String sourceClass, String sourceMethod, String msg)
logp
in class Logger
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)
logp
in class Logger
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params)
logp
in class Logger
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)
logp
in class Logger
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)
logrb
in class Logger
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)
logrb
in class Logger
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params)
logrb
in class Logger
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)
logrb
in class Logger
public void log(String fqcn, Level level, String message, String bundleName, ExtLogRecord.FormatStyle style, Object[] params, Throwable t)
fqcn
- the fully qualified class name of the first logger classlevel
- the level to log atmessage
- the messagebundleName
- the resource bundle namestyle
- the message format styleparams
- the log parameterst
- the throwable, if anypublic void log(String fqcn, Level level, String message, ExtLogRecord.FormatStyle style, Object[] params, Throwable t)
fqcn
- the fully qualified class name of the first logger classlevel
- the level to log atmessage
- the messagestyle
- the message format styleparams
- the log parameterst
- the throwable, if anypublic void log(String fqcn, Level level, String message, Throwable t)
fqcn
- the fully qualified class name of the first logger classlevel
- the level to log atmessage
- the messaget
- the throwable, if anypublic void logRaw(ExtLogRecord record)
record
- the extended log recordpublic void logRaw(LogRecord record)
record
- the log recordpublic String toString()
toString
in class Object
|
JBoss Log Manager 1.2.0.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |