public class ApiLogger extends Logger
Logger
class. Note that this implementation does
not use the Handler
class. Instead, logging is delegated to the
underlying Log4j Logger
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()
and setLevel(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. The
Logger.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.
global, GLOBAL_LOGGER_NAME
Modifier and Type | Method and Description |
---|---|
void |
config(String msg) |
protected void |
doSetLevel(Level newLevel)
Provides access to
Logger.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) |
addHandler, config, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getGlobal, getHandlers, getLevel, getLogger, getLogger, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, log, log, logp, logp, logrb, logrb, removeHandler, setFilter, setResourceBundle, setUseParentHandlers, severe, warning
public boolean isLoggable(Level level)
isLoggable
in class Logger
public void setLevel(Level newLevel) throws SecurityException
setLevel
in class Logger
SecurityException
protected void doSetLevel(Level newLevel) throws SecurityException
Logger.setLevel(java.util.logging.Level)
. This method should only be used by child
classes.SecurityException
Logger.setLevel(java.util.logging.Level)
public void setParent(Logger parent)
setParent
in class Logger
UnsupportedOperationException
- alwayspublic void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params)
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)
Copyright © 1999-2021 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.