Save This Page
Home » openjdk-7 » sun.util.logging » [javadoc | source]
sun.util.logging
public class: PlatformLogger [javadoc | source]
java.lang.Object
   sun.util.logging.PlatformLogger
Platform logger provides an API for the JRE components to log messages. This enables the runtime components to eliminate the static dependency of the logging facility and also defers the java.util.logging initialization until it is enabled. In addition, the PlatformLogger API can be used if the logging module does not exist. If the logging facility is not enabled, the platform loggers will output log messages per the default logging configuration (see below). In this implementation, it does not log the the stack frame information issuing the log message. When the logging facility is enabled (at startup or runtime), the java.util.logging.Logger will be created for each platform logger and all log messages will be forwarded to the Logger to handle. Logging facility is "enabled" when one of the following conditions is met: 1) a system property "java.util.logging.config.class" or "java.util.logging.config.file" is set 2) java.util.logging.LogManager or java.util.logging.Logger is referenced that will trigger the logging initialization. Default logging configuration: global logging level = INFO handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = INFO java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter Limitation: /lib/logging.properties is the system-wide logging configuration defined in the specification and read in the default case to configure any java.util.logging.Logger instances. Platform loggers will not detect if /lib/logging.properties is modified. In other words, unless the java.util.logging API is used at runtime or the logging system properties is set, the platform loggers will use the default setting described above. The platform loggers are designed for JDK developers use and this limitation can be workaround with setting -Djava.util.logging.config.file system property.
    since: 1.7 -
Nested Class Summary:
static class  PlatformLogger.LoggerProxy  Default platform logging support - output messages to System.err - equivalent to ConsoleHandler with SimpleFormatter. 
static class  PlatformLogger.JavaLogger  JavaLogger forwards all the calls to its corresponding java.util.logging.Logger object. 
Field Summary
public static final  int OFF     
public static final  int SEVERE     
public static final  int WARNING     
public static final  int INFO     
public static final  int CONFIG     
public static final  int FINE     
public static final  int FINER     
public static final  int FINEST     
public static final  int ALL     
Method from sun.util.logging.PlatformLogger Summary:
config,   config,   config,   fine,   fine,   fine,   finer,   finer,   finer,   finest,   finest,   finest,   getLevel,   getLogger,   getName,   info,   info,   info,   isEnabled,   isLoggable,   redirectPlatformLoggers,   setLevel,   severe,   severe,   severe,   warning,   warning,   warning
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.util.logging.PlatformLogger Detail:
 public  void config(String msg) 
    Logs a CONFIG message.
 public  void config(String msg,
    Throwable t) 
 public  void config(String msg,
    Object params) 
 public  void fine(String msg) 
    Logs a FINE message.
 public  void fine(String msg,
    Throwable t) 
 public  void fine(String msg,
    Object params) 
 public  void finer(String msg) 
    Logs a FINER message.
 public  void finer(String msg,
    Throwable t) 
 public  void finer(String msg,
    Object params) 
 public  void finest(String msg) 
    Logs a FINEST message.
 public  void finest(String msg,
    Throwable t) 
 public  void finest(String msg,
    Object params) 
 public int getLevel() 
    Gets the current log level. Returns 0 if the current effective level is not set (equivalent to Logger.getLevel() returns null).
 public static synchronized PlatformLogger getLogger(String name) 
    Returns a PlatformLogger of a given name.
 public String getName() 
    Gets the name for this platform logger.
 public  void info(String msg) 
    Logs an INFO message.
 public  void info(String msg,
    Throwable t) 
 public  void info(String msg,
    Object params) 
 public boolean isEnabled() 
    A convenience method to test if the logger is turned off. (i.e. its level is OFF).
 public boolean isLoggable(int level) 
    Returns true if a message of the given level would actually be logged by this logger.
 public static synchronized  void redirectPlatformLoggers() 
    Initialize java.util.logging.Logger objects for all platform loggers. This method is called from LogManager.readPrimordialConfiguration().
 public  void setLevel(int newLevel) 
    Sets the log level.
 public  void severe(String msg) 
    Logs a SEVERE message.
 public  void severe(String msg,
    Throwable t) 
 public  void severe(String msg,
    Object params) 
 public  void warning(String msg) 
    Logs a WARNING message.
 public  void warning(String msg,
    Throwable t) 
 public  void warning(String msg,
    Object params)