org.apache.logging.log4j.jul
Class ApiLogger

java.lang.Object
  extended by java.util.logging.Logger
      extended by org.apache.logging.log4j.jul.ApiLogger
Direct Known Subclasses:
CoreLogger

public class ApiLogger
extends Logger

Log4j API implementation of the JUL 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.

Since:
2.1

Field Summary
 
Fields inherited from class java.util.logging.Logger
global, GLOBAL_LOGGER_NAME
 
Method Summary
 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)
           
 
Methods inherited from class java.util.logging.Logger
addHandler, getAnonymousLogger, getAnonymousLogger, getFilter, getHandlers, getLevel, getLogger, getLogger, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, removeHandler, setFilter, setUseParentHandlers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

log

public void log(LogRecord record)
Overrides:
log in class Logger

isLoggable

public boolean isLoggable(Level level)
Overrides:
isLoggable in class Logger

getName

public String getName()
Overrides:
getName in class Logger

setLevel

public void setLevel(Level newLevel)
              throws SecurityException
Overrides:
setLevel in class Logger
Throws:
SecurityException

doSetLevel

protected void doSetLevel(Level newLevel)
                   throws SecurityException
Provides access to Logger.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 class Logger
Throws:
UnsupportedOperationException - always

log

public void log(Level level,
                String msg)
Overrides:
log in class Logger

log

public void log(Level level,
                String msg,
                Object param1)
Overrides:
log in class Logger

log

public void log(Level level,
                String msg,
                Object[] params)
Overrides:
log in class Logger

log

public void log(Level level,
                String msg,
                Throwable thrown)
Overrides:
log in class Logger

logp

public void logp(Level level,
                 String sourceClass,
                 String sourceMethod,
                 String msg)
Overrides:
logp in class Logger

logp

public void logp(Level level,
                 String sourceClass,
                 String sourceMethod,
                 String msg,
                 Object param1)
Overrides:
logp in class Logger

logp

public void logp(Level level,
                 String sourceClass,
                 String sourceMethod,
                 String msg,
                 Object[] params)
Overrides:
logp in class Logger

logp

public void logp(Level level,
                 String sourceClass,
                 String sourceMethod,
                 String msg,
                 Throwable thrown)
Overrides:
logp in class Logger

logrb

public void logrb(Level level,
                  String sourceClass,
                  String sourceMethod,
                  String bundleName,
                  String msg)
Overrides:
logrb in class Logger

logrb

public void logrb(Level level,
                  String sourceClass,
                  String sourceMethod,
                  String bundleName,
                  String msg,
                  Object param1)
Overrides:
logrb in class Logger

logrb

public void logrb(Level level,
                  String sourceClass,
                  String sourceMethod,
                  String bundleName,
                  String msg,
                  Object[] params)
Overrides:
logrb in class Logger

logrb

public void logrb(Level level,
                  String sourceClass,
                  String sourceMethod,
                  String bundleName,
                  String msg,
                  Throwable thrown)
Overrides:
logrb in class Logger

entering

public void entering(String sourceClass,
                     String sourceMethod)
Overrides:
entering in class Logger

entering

public void entering(String sourceClass,
                     String sourceMethod,
                     Object param1)
Overrides:
entering in class Logger

entering

public void entering(String sourceClass,
                     String sourceMethod,
                     Object[] params)
Overrides:
entering in class Logger

exiting

public void exiting(String sourceClass,
                    String sourceMethod)
Overrides:
exiting in class Logger

exiting

public void exiting(String sourceClass,
                    String sourceMethod,
                    Object result)
Overrides:
exiting in class Logger

throwing

public void throwing(String sourceClass,
                     String sourceMethod,
                     Throwable thrown)
Overrides:
throwing in class Logger

severe

public void severe(String msg)
Overrides:
severe in class Logger

warning

public void warning(String msg)
Overrides:
warning in class Logger

info

public void info(String msg)
Overrides:
info in class Logger

config

public void config(String msg)
Overrides:
config in class Logger

fine

public void fine(String msg)
Overrides:
fine in class Logger

finer

public void finer(String msg)
Overrides:
finer in class Logger

finest

public void finest(String msg)
Overrides:
finest in class Logger


Copyright © 1999-2015 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.