Top Description Inners Fields Constructors Methods
org.jboss.logmanager

public final Class Logger

extends Logger
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:SerializableClassWithUnconstructableAncestor
Static Imports
org.jboss.logmanager.ExtLogRecord.FormatStyle.MESSAGE_FORMAT, .ExtLogRecord.FormatStyle.NO_FORMAT

An actual logger instance. This is the end-user interface into the logging system.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Logger.AttachmentKey<
the attachment value type
V
>

An attachment key instance.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
private static final String
private final LoggerNode
loggerNode

The named logger tree node.

pack-priv static final int
private volatile ResourceBundle
resourceBundle

The resource bundle for this logger.

private static final long
pack-priv static final int
private static final ResourceBundle
pack-priv static final int
Inherited from java.util.logging.Logger:
globalGLOBAL_LOGGER_NAME

Constructor Summary

AccessConstructor and Description
pack-priv
Logger(final LoggerNode
the node in the named logger tree
loggerNode
,
final String
the fully-qualified name of this node
name
)

Construct a new instance of an actual logger.

Method Summary

Modifier and TypeMethod and Description
public void
addHandler(Handler
a logging Handler
handler
)

Overrides java.util.logging.Logger.addHandler.

Add a log Handler to receive logging messages.

public <
the attachment value type
V
>
V

Returns:

the old attachment, if there was one
attach
(Logger.AttachmentKey<V>
the attachment key
key
,
V
the attachment value
value
)

Attach an object to this logger under a given key.

public <
the attachment value type
V
>
V

Returns:

the current attachment, if there is one, or null if the value was successfully attached
attachIfAbsent
(Logger.AttachmentKey<V>
the attachment key
key
,
V
the attachment value
value
)

Attach an object to this logger under a given key, if such an attachment does not already exist.

public Handler[]
clearHandlers()

A convenience method to atomically get and clear all handlers.

public boolean

Returns:

true if the handler list was updated or false if the current handlers did not match the expected handlers list
compareAndSetHandlers
(final Handler[]
the expected list of handlers
expected
,
final Handler[]
the replacement list of handlers
newHandlers
)

Atomically compare and set the handler list for this logger.

public void
config(final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.config.

Log a CONFIG message.

public void
config(final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.config.

Log a CONFIG message, which is only to be constructed if the logging level is such that the message will actually be logged.

public <
the attachment value type
V
>
V

Returns:

the old value, or null if there was none
detach
(Logger.AttachmentKey<V>
the attachment key
key
)

Remove an attachment.

public void
entering(final String
name of class that issued the logging request
sourceClass
,
final String
name of method that is being entered
sourceMethod
)

Overrides java.util.logging.Logger.entering.

Log a method entry.

public void
entering(final String
name of class that issued the logging request
sourceClass
,
final String
name of method that is being entered
sourceMethod
,
final Object
parameter to the method being entered
param1
)

Overrides java.util.logging.Logger.entering.

Log a method entry, with one parameter.

public void
entering(final String
name of class that issued the logging request
sourceClass
,
final String
name of method that is being entered
sourceMethod
,
final Object[]
array of parameters to the method being entered
params
)

Overrides java.util.logging.Logger.entering.

Log a method entry, with an array of parameters.

public void
exiting(final String
name of class that issued the logging request
sourceClass
,
final String
name of the method
sourceMethod
)

Overrides java.util.logging.Logger.exiting.

Log a method return.

public void
exiting(final String
name of class that issued the logging request
sourceClass
,
final String
name of the method
sourceMethod
,
final Object
Object that is being returned
result
)

Overrides java.util.logging.Logger.exiting.

Log a method return, with result object.

public void
fine(final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.fine.

Log a FINE message.

public void
fine(final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.fine.

Log a FINE message, which is only to be constructed if the logging level is such that the message will actually be logged.

public void
finer(final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.finer.

Log a FINER message.

public void
finer(final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.finer.

Log a FINER message, which is only to be constructed if the logging level is such that the message will actually be logged.

public void
finest(final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.finest.

Log a FINEST message.

public void
finest(final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.finest.

Log a FINEST message, which is only to be constructed if the logging level is such that the message will actually be logged.

public Handler[]

Returns:

the old handler set
getAndSetHandlers
(final Handler[]
the new handler set
handlers
)

Atomically get and set the handler list for this logger.

public <
the attachment value type
V
>
V

Returns:

the attachment, or null if there is none for this key
getAttachment
(Logger.AttachmentKey<V>
the key
key
)

Get the attachment value for a given key, or null if there is no such attachment.

public int

Returns:

the effective level
getEffectiveLevel
()

Get the effective numerical log level, inherited from the parent.

public Filter
getFilter()

Overrides java.util.logging.Logger.getFilter.

Get the current filter for this Logger.

public Handler[]
getHandlers()

Overrides java.util.logging.Logger.getHandlers.

Get the Handlers associated with this logger.

public Level
getLevel()

Overrides java.util.logging.Logger.getLevel.

Get the log Level that has been specified for this Logger.

public LogContext

Returns:

the log context
getLogContext
()

Get the log context to which this logger belongs.

public static Logger

Returns:

the logger
getLogger
(final String
the logger name
name
)

Hides java.util.logging.Logger.getLogger.

Static logger factory method which returns a JBoss LogManager logger.

public static Logger

Returns:

the logger
getLogger
(final String
the logger name
name
,
final String
the bundle name
bundleName
)

Hides java.util.logging.Logger.getLogger.

Static logger factory method which returns a JBoss LogManager logger.

public Logger
getParent()

Overrides java.util.logging.Logger.getParent.

Return the parent for this Logger.

public ResourceBundle

Returns:

the resource bundle, or null if none is configured for this logger
getResourceBundle
()

Overrides java.util.logging.Logger.getResourceBundle.

Get the resource bundle for this logger.

public boolean

Returns:

true if filters are inherited, otherwise false
getUseParentFilters
()

Indicates whether or not this logger inherits filters from it's parent logger.

public boolean
getUseParentHandlers()

Overrides java.util.logging.Logger.getUseParentHandlers.

Discover whether or not this logger is sending its output to its parent logger.

public void
info(final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.info.

Log an INFO message.

public void
info(final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.info.

Log a INFO message, which is only to be constructed if the logging level is such that the message will actually be logged.

public boolean
isLoggable(Level
a message logging level
level
)

Overrides java.util.logging.Logger.isLoggable.

Check if a message of the given level would actually be logged by this logger.

public void
log(LogRecord
the LogRecord to be published
record
)

Overrides java.util.logging.Logger.log.

Log a LogRecord.

public void
log(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.log.

Log a message, with no arguments.

public void
log(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.log.

Log a message, which is only to be constructed if the logging level is such that the message will actually be logged.

public void
log(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
The string message (or a key in the message catalog)
msg
,
final Object
parameter to the message
param1
)

Overrides java.util.logging.Logger.log.

Log a message, with one object parameter.

public void
log(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
The string message (or a key in the message catalog)
msg
,
final Object[]
array of parameters to the message
params
)

Overrides java.util.logging.Logger.log.

Log a message, with an array of object arguments.

public void
log(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
The string message (or a key in the message catalog)
msg
,
final Throwable
Throwable associated with log message.
thrown
)

Overrides java.util.logging.Logger.log.

Log a message, with associated Throwable information.

public void
log(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final Throwable
Throwable associated with log message.
thrown
,
final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.log.

Log a lazily constructed message, with associated Throwable information.

public void
log(final String
the fully qualified class name of the first logger class
fqcn
,
final Level
the level to log at
level
,
final String
the message
message
,
final String
the resource bundle name
bundleName
,
final ExtLogRecord.FormatStyle
the message format style
style
,
final Object[]
the log parameters
params
,
final Throwable
the throwable, if any
t
)

SPI interface method to log a message at a given level, with a specific resource bundle.

public void
log(final String
the fully qualified class name of the first logger class
fqcn
,
final Level
the level to log at
level
,
final String
the message
message
,
final ExtLogRecord.FormatStyle
the message format style
style
,
final Object[]
the log parameters
params
,
final Throwable
the throwable, if any
t
)

SPI interface method to log a message at a given level.

public void
log(final String
the fully qualified class name of the first logger class
fqcn
,
final Level
the level to log at
level
,
final String
the message
message
,
final Throwable
the throwable, if any
t
)

SPI interface method to log a message at a given level.

public void
logp(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.logp.

Log a message, specifying source class and method, with no arguments.

public void
logp(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.logp.

Log a lazily constructed message, specifying source class and method, with no arguments.

public void
logp(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
The string message (or a key in the message catalog)
msg
,
final Object
Parameter to the log message.
param1
)

Overrides java.util.logging.Logger.logp.

Log a message, specifying source class and method, with a single object parameter to the log message.

public void
logp(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
The string message (or a key in the message catalog)
msg
,
final Object[]
Array of parameters to the message
params
)

Overrides java.util.logging.Logger.logp.

Log a message, specifying source class and method, with an array of object arguments.

public void
logp(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
The string message (or a key in the message catalog)
msg
,
final Throwable
Throwable associated with log message.
thrown
)

Overrides java.util.logging.Logger.logp.

Log a message, specifying source class and method, with associated Throwable information.

public void
logp(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final Throwable
Throwable associated with log message.
thrown
,
final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.logp.

Log a lazily constructed message, specifying source class and method, with associated Throwable information.

public void
logRaw(final ExtLogRecord
the extended log record
record
)

Do the logging with no level checks (they've already been done).

public void
logRaw(final LogRecord
the log record
record
)

Do the logging with no level checks (they've already been done).

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
name of resource bundle to localize msg, can be null
bundleName
,
final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.logrb.

Deprecated for removal since 3.0.

Log a message, specifying source class, method, and resource bundle name with no arguments.

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
name of resource bundle to localize msg, can be null
bundleName
,
final String
The string message (or a key in the message catalog)
msg
,
final Object
Parameter to the log message.
param1
)

Overrides java.util.logging.Logger.logrb.

Deprecated for removal since 3.0.

Log a message, specifying source class, method, and resource bundle name, with a single object parameter to the log message.

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
name of resource bundle to localize msg, can be null.
bundleName
,
final String
The string message (or a key in the message catalog)
msg
,
final Object[]
Array of parameters to the message
params
)

Overrides java.util.logging.Logger.logrb.

Deprecated for removal since 3.0.

Log a message, specifying source class, method, and resource bundle name, with an array of object arguments.

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
name of class that issued the logging request
sourceClass
,
final String
name of method that issued the logging request
sourceMethod
,
final String
name of resource bundle to localize msg, can be null
bundleName
,
final String
The string message (or a key in the message catalog)
msg
,
final Throwable
Throwable associated with log message.
thrown
)

Overrides java.util.logging.Logger.logrb.

Deprecated for removal since 3.0.

Log a message, specifying source class, method, and resource bundle name, with associated Throwable information.

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
Name of the class that issued the logging request
sourceClass
,
final String
Name of the method that issued the logging request
sourceMethod
,
final ResourceBundle
Resource bundle to localize msg, can be null.
bundle
,
final String
The string message (or a key in the message catalog)
msg
,
final Object...
Parameters to the message (optional, may be none).
params
)

Overrides java.util.logging.Logger.logrb.

Log a message, specifying source class, method, and resource bundle, with an optional list of message parameters.

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final ResourceBundle
Resource bundle to localize msg; can be null.
bundle
,
final String
The string message (or a key in the message catalog)
msg
,
final Object...
Parameters to the message (optional, may be none).
params
)

Overrides java.util.logging.Logger.logrb.

Log a message, specifying source class, method, and resource bundle, with an optional list of message parameters.

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final String
Name of the class that issued the logging request
sourceClass
,
final String
Name of the method that issued the logging request
sourceMethod
,
final ResourceBundle
Resource bundle to localize msg, can be null
bundle
,
final String
The string message (or a key in the message catalog)
msg
,
final Throwable
Throwable associated with the log message.
thrown
)

Overrides java.util.logging.Logger.logrb.

Log a message, specifying source class, method, and resource bundle, with associated Throwable information.

public void
logrb(final Level
One of the message level identifiers, e.g., SEVERE
level
,
final ResourceBundle
Resource bundle to localize msg; can be null.
bundle
,
final String
The string message (or a key in the message catalog)
msg
,
final Throwable
Throwable associated with the log message.
thrown
)

Overrides java.util.logging.Logger.logrb.

Log a message, specifying source class, method, and resource bundle, with associated Throwable information.

public void
removeHandler(Handler
a logging Handler
handler
)

Overrides java.util.logging.Logger.removeHandler.

Remove a log Handler.

public void
setFilter(Filter
a filter object (may be null)
filter
)

Overrides java.util.logging.Logger.setFilter.

Set a filter to control output on this Logger.

public void
setHandlers(final Handler[]
the new handlers
handlers
)

A convenience method to atomically replace the handler list for this logger.

public void
setLevel(Level
the new value for the log level (may be null)
newLevel
)

Overrides java.util.logging.Logger.setLevel.

Set the log level specifying which message levels will be logged by this logger.

public void
setLevelName(String
the name of the level to set
newLevelName
)

Set the log level by name.

public void
setParent(Logger
the new parent logger
parent
)

Overrides java.util.logging.Logger.setParent.

Not allowed.

public void
setResourceBundle(ResourceBundle
the resource bundle (must not be null)
resourceBundle
)

Overrides java.util.logging.Logger.setResourceBundle.

Set the resource bundle for this logger.

public void
setUseParentFilters(final boolean
true to inherit a parents filter, otherwise false
useParentFilter
)

Specify whether or not filters should be inherited from parent loggers.

public void
setUseParentHandlers(boolean
true if output is to be sent to the logger's parent.
useParentHandlers
)

Overrides java.util.logging.Logger.setUseParentHandlers.

Specify whether or not this logger should send its output to its parent Logger.

public void
severe(final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.severe.

Log a SEVERE message.

public void
severe(final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.severe.

Log a SEVERE message, which is only to be constructed if the logging level is such that the message will actually be logged.

public void
throwing(final String
name of class that issued the logging request
sourceClass
,
final String
name of the method.
sourceMethod
,
final Throwable
The Throwable that is being thrown.
thrown
)

Overrides java.util.logging.Logger.throwing.

Log throwing an exception.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
warning(final String
The string message (or a key in the message catalog)
msg
)

Overrides java.util.logging.Logger.warning.

Log a WARNING message.

public void
warning(final Supplier<String>
A function, which when called, produces the desired log message
msgSupplier
)

Overrides java.util.logging.Logger.warning.

Log a WARNING message, which is only to be constructed if the logging level is such that the message will actually be logged.

protected final Object
Inherited from java.util.logging.Logger:
getAnonymousLoggergetAnonymousLoggergetGlobalgetNamegetResourceBundleName