Package org.apache.logging.log4j.jul
Class ApiLogger
- java.lang.Object
-
- java.util.logging.Logger
-
- org.apache.logging.log4j.jul.ApiLogger
-
- Direct Known Subclasses:
CoreLogger
public class ApiLogger extends Logger
Log4j API implementation of the JULLogger
class. Note that this implementation does not use theHandler
class. Instead, logging is delegated to the underlying Log4jLogger
which may be implemented in one of many different ways. Consult the documentation for your Log4j Provider for more details.Note that the methods
Logger.getParent()
andsetLevel(java.util.logging.Level)
are not supported by this implementation. If you need support for these methods, then you'll need to use log4j-core. TheLogger.getParent()
method will not fail (thanks to JUL API limitations), but it won't necessarily be accurate!Also note that
setParent(java.util.logging.Logger)
is explicitly unsupported. Parent loggers are determined using the syntax of the logger name; not through an arbitrary graph of loggers.- Since:
- 2.1
-
-
Field Summary
-
Fields inherited from class java.util.logging.Logger
global, GLOBAL_LOGGER_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config(String msg)
protected void
doSetLevel(Level newLevel)
Provides access toLogger.setLevel(java.util.logging.Level)
.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)
String
getName()
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
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
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
setLevel(Level newLevel)
void
setParent(Logger parent)
Unsupported operation.void
severe(String msg)
void
throwing(String sourceClass, String sourceMethod, Throwable thrown)
void
warning(String msg)
-
Methods inherited from class java.util.logging.Logger
addHandler, config, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getGlobal, getHandlers, getLevel, getLogger, getLogger, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, log, log, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setResourceBundle, setUseParentHandlers, severe, warning
-
-
-
-
Method Detail
-
isLoggable
public boolean isLoggable(Level level)
- Overrides:
isLoggable
in classLogger
-
setLevel
public void setLevel(Level newLevel) throws SecurityException
- Overrides:
setLevel
in classLogger
- Throws:
SecurityException
-
doSetLevel
protected void doSetLevel(Level newLevel) throws SecurityException
Provides access toLogger.setLevel(java.util.logging.Level)
. This method should only be used by child classes.- Throws:
SecurityException
- See Also:
Logger.setLevel(java.util.logging.Level)
-
setParent
public void setParent(Logger parent)
Unsupported operation.- Overrides:
setParent
in classLogger
- Throws:
UnsupportedOperationException
- always
-
logp
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)
-
logp
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params)
-
logp
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)
-
-