Top Description Fields Constructors Methods
org.apache.logging.log4j.jul

public Class CoreLogger

extends ApiLogger
Class Inheritance
Imports
java.util.logging.Level, .Logger

Log4j Core implementation of the JUL Logger class. Note that this implementation does not use the java.util.logging.Handler class. Instead, logging is delegated to the underlying Log4j org.apache.logging.log4j.core.Logger which uses Appenders instead.
Since
2.1

Field Summary

Modifier and TypeField and Description
private final org.apache.logging.log4j.core.Logger

Constructor Summary

AccessConstructor and Description
pack-priv
CoreLogger(final org.apache.logging.log4j.core.Logger
the underlying Logger to base this Logger on
logger
)

Constructs a Logger using a Log4j org.apache.logging.log4j.core.Logger.

Method Summary

Modifier and TypeMethod and Description
public Logger
getParent()

Overrides java.util.logging.Logger.getParent.

Return the parent for this Logger.

public synchronized boolean

Returns:

true if this Logger is additive, or false otherwise
getUseParentHandlers
()

Overrides java.util.logging.Logger.getUseParentHandlers.

Indicates if the underlying org.apache.logging.log4j.core.Logger is additive.

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

Overrides org.apache.logging.log4j.jul.ApiLogger.setLevel.

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

public synchronized void
setUseParentHandlers(final boolean
true if this Logger should be additive
additive
)

Overrides java.util.logging.Logger.setUseParentHandlers.

Marks the underlying org.apache.logging.log4j.core.Logger as additive.

Inherited from org.apache.logging.log4j.jul.ApiLogger:
configdoSetLevelenteringenteringenteringexitingexitingfinefinerfinestgetNameinfoisFilteredisLoggableloglogloglogloglogplogplogplogplogrblogrblogrblogrbsetParentseverethrowingwarning

Field Detail

loggerback to summary
private final org.apache.logging.log4j.core.Logger logger

Hides org.apache.logging.log4j.jul.ApiLogger.logger.

Constructor Detail

CoreLoggerback to summary
pack-priv CoreLogger(final org.apache.logging.log4j.core.Logger logger)

Constructs a Logger using a Log4j org.apache.logging.log4j.core.Logger.

Parameters
logger:org.apache.logging.log4j.core.Logger

the underlying Logger to base this Logger on

Method Detail

getParentback to summary
public Logger getParent()

Overrides java.util.logging.Logger.getParent.

Doc from java.util.logging.Logger.getParent.

Return the parent for this Logger.

This method returns the nearest extant 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.

Returns:Logger

nearest existing parent Logger

Annotations
@Override
getUseParentHandlersback to summary
public synchronized boolean getUseParentHandlers()

Overrides java.util.logging.Logger.getUseParentHandlers.

Indicates if the underlying org.apache.logging.log4j.core.Logger is additive. Note that the Log4j version of JDK Loggers do not use Handlers.

Returns:boolean

true if this Logger is additive, or false otherwise

Annotations
@Override
See Also
org.apache.logging.log4j.core.Logger#isAdditive()
setLevelback to summary
public void setLevel(final Level level) throws SecurityException

Overrides org.apache.logging.log4j.jul.ApiLogger.setLevel.

Doc from java.util.logging.Logger.setLevel.

Set the log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded. The level value Level.OFF can be used to turn off logging.

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.

Parameters
level:Level

the new value for the log level (may be null)

Annotations
@Override
Exceptions
SecurityException:
if a security manager exists, this logger is not anonymous, and the caller does not have LoggingPermission("control").
setUseParentHandlersback to summary
public synchronized void setUseParentHandlers(final boolean additive)

Overrides java.util.logging.Logger.setUseParentHandlers.

Marks the underlying org.apache.logging.log4j.core.Logger as additive.

Parameters
additive:boolean

true if this Logger should be additive

Annotations
@Override
See Also
org.apache.logging.log4j.core.Logger#setAdditive(boolean)