PlatformLogger.Bridge.convert(
jdk.internal.logger.LazyLoggers#getLazyLogger(name, PlatformLogger.class))
.
Logging facility is "enabled" when one of the following
conditions is met:
1) ServiceLoader.load(LoggerFinder.class
,
ClassLoader.getSystemClassLoader()).iterator().hasNext().
2) ServiceLoader.loadInstalled(jdk.internal.logger.DefaultLoggerFinder
).iterator().hasNext(),
and 2.1) a system property "java.util.logging.config.class" or
"java.util.logging.config.file" is set
or 2.2) java.util.logging.LogManager or java.util.logging.Logger
is referenced that will trigger the logging initialization.
Default logging configuration:
No LoggerFinder service implementation declared
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:
<JAVA_HOME>/conf/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 <JAVA_HOME>/conf/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.
setLevel
is now deprecated.
Modifier and Type | Class and Description |
---|---|
public static interface | PlatformLogger.
The PlatformLogger.Bridge interface is implemented by the System.Logger objects returned by our default JUL provider - so that JRE classes using PlatformLogger see no difference when JUL is the actual backend. |
public static interface | PlatformLogger.
The |
public static enum | PlatformLogger.
PlatformLogger logging levels. |
Modifier and Type | Field and Description |
---|---|
private final PlatformLogger. | |
private static final Map | |
private static final PlatformLogger. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public static synchronized PlatformLogger | |
public String | |
public void | |
public void | |
public void | |
public boolean | Returns: whether the logger is turned off.A convenience method to test if the logger is turned off. |
public boolean | Returns: whether a message of that level would be loggedthe level levelReturns true if a message of the given level would actually be logged by this logger. |
public PlatformLogger. | Returns: this PlatformLogger's levelGet the log level that has been specified for this PlatformLogger. |
public void | setLevel(PlatformLogger.
the new value for the log level (may be null) newLevel
Deprecated
Platform Loggers should not be configured programmatically.
Set the log level specifying which message levels will be logged by this logger. |
public void | |
public void | |
public void | |
public static PlatformLogger. | |
public void | |
public void | |
public void |
loggerProxy | back to summary |
---|---|
private final PlatformLogger. |
loggers | back to summary |
---|---|
private static final Map<String, WeakReference<PlatformLogger>> loggers |
spi2platformLevelMapping | back to summary |
---|---|
private static final PlatformLogger. |
PlatformLogger | back to summary |
---|---|
private PlatformLogger(PlatformLogger. |
config | back to summary |
---|---|
public void config(String msg) Logs a CONFIG message.
|
config | back to summary |
---|---|
public void config(String msg, Throwable t) |
config | back to summary |
---|---|
public void config(String msg, Object... params) |
fine | back to summary |
---|---|
public void fine(String msg) Logs a FINE message.
|
fine | back to summary |
---|---|
public void fine(String msg, Throwable t) |
fine | back to summary |
---|---|
public void fine(String msg, Object... params) |
finer | back to summary |
---|---|
public void finer(String msg) Logs a FINER message.
|
finer | back to summary |
---|---|
public void finer(String msg, Throwable t) |
finer | back to summary |
---|---|
public void finer(String msg, Object... params) |
finest | back to summary |
---|---|
public void finest(String msg) Logs a FINEST message.
|
finest | back to summary |
---|---|
public void finest(String msg, Throwable t) |
finest | back to summary |
---|---|
public void finest(String msg, Object... params) |
getLogger | back to summary |
---|---|
public static synchronized PlatformLogger getLogger(String name) Returns a PlatformLogger of a given name.
|
getName | back to summary |
---|---|
public String getName() Gets the name for this platform logger.
|
info | back to summary |
---|---|
public void info(String msg) Logs an INFO message.
|
info | back to summary |
---|---|
public void info(String msg, Throwable t) |
info | back to summary |
---|---|
public void info(String msg, Object... params) |
isEnabled | back to summary |
---|---|
public boolean isEnabled() A convenience method to test if the logger is turned off. (i.e. its level is OFF).
|
isLoggable | back to summary |
---|---|
public boolean isLoggable(PlatformLogger. Returns true if a message of the given level would actually be logged by this logger.
|
level | back to summary |
---|---|
public PlatformLogger. Get the log level that has been specified for this PlatformLogger. The result may be null, which means that this logger's effective level will be inherited from its parent.
|
setLevel | back to summary |
---|---|
public void setLevel(PlatformLogger. Deprecated Platform Loggers should not be configured programmatically.
This method will not work if a custom 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 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.
|
severe | back to summary |
---|---|
public void severe(String msg) Logs a SEVERE message.
|
severe | back to summary |
---|---|
public void severe(String msg, Throwable t) |
severe | back to summary |
---|---|
public void severe(String msg, Object... params) |
toPlatformLevel | back to summary |
---|---|
public static PlatformLogger. |
warning | back to summary |
---|---|
public void warning(String msg) Logs a WARNING message.
|
warning | back to summary |
---|---|
public void warning(String msg, Throwable t) |
warning | back to summary |
---|---|
public void warning(String msg, Object... params) |
Modifier and Type | Method and Description |
---|---|
public static PlatformLogger. | |
public String | |
public boolean | |
public boolean | Returns: whether a message of that level would be loggedthe level levelReturns true if a message of the given level would actually be logged by this logger. |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | logrb(PlatformLogger.
|
public void | logrb(PlatformLogger.
|
public void | |
public void |
convert | back to summary |
---|---|
public static PlatformLogger. |
getName | back to summary |
---|---|
public String getName() Gets the name for this platform logger.
|
isEnabled | back to summary |
---|---|
public boolean isEnabled() |
isLoggable | back to summary |
---|---|
public boolean isLoggable(PlatformLogger. Returns true if a message of the given level would actually be logged by this logger.
|
log | back to summary |
---|---|
public void log(PlatformLogger. |
log | back to summary |
---|---|
public void log(PlatformLogger. |
log | back to summary |
---|---|
public void log(PlatformLogger. |
log | back to summary |
---|---|
public void log(PlatformLogger. |
log | back to summary |
---|---|
public void log(PlatformLogger. |
logp | back to summary |
---|---|
public void logp(PlatformLogger. |
logp | back to summary |
---|---|
public void logp(PlatformLogger. |
logp | back to summary |
---|---|
public void logp(PlatformLogger. |
logp | back to summary |
---|---|
public void logp(PlatformLogger. |
logp | back to summary |
---|---|
public void logp(PlatformLogger. |
logrb | back to summary |
---|---|
public void logrb(PlatformLogger. |
logrb | back to summary |
---|---|
public void logrb(PlatformLogger. |
logrb | back to summary |
---|---|
public void logrb(PlatformLogger. |
logrb | back to summary |
---|---|
public void logrb(PlatformLogger. |
PlatformLogger.ConfigurableBridge
interface is used to
implement the deprecated PlatformLogger#setLevel
method.
PlatformLogger is now only a thin adaptation layer over the same
loggers than returned by java.lang.System.getLogger(String name).
The recommendation for JRE classes going forward is to use
java.lang.System.getLogger(String name), which will
use Lazy Loggers when possible and necessary.
Modifier and Type | Class and Description |
---|---|
public abstract static class |
Modifier and Type | Method and Description |
---|---|
public default PlatformLogger. | |
public static PlatformLogger. |
getLoggerConfiguration | back to summary |
---|---|
public default PlatformLogger. |
getLoggerConfiguration | back to summary |
---|---|
public static PlatformLogger. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public abstract PlatformLogger. | |
public abstract void |
LoggerConfiguration | back to summary |
---|---|
public LoggerConfiguration() |
getPlatformLevel | back to summary |
---|---|
public abstract PlatformLogger. |
setPlatformLevel | back to summary |
---|---|
public abstract void setPlatformLevel(PlatformLogger. |
Modifier and Type | Field and Description |
---|---|
public static final PlatformLogger. | |
public static final PlatformLogger. | |
public static final PlatformLogger. | |
public static final PlatformLogger. | |
public static final PlatformLogger. | |
public static final PlatformLogger. | |
private static final int[] | |
public static final PlatformLogger. | |
public static final PlatformLogger. | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
pack-priv final System. | |
public static final PlatformLogger. |
Modifier and Type | Method and Description |
---|---|
public int | |
public System. | |
public static PlatformLogger. | |
public static PlatformLogger. | Returns: The effective logger level, which is the nearest Level value whose severity is greater or equal to the given level. For level > SEVERE (OFF excluded), return SEVERE.The severity of the messages that should be
logged with a logger set to the returned level. level)Maps a severity value to an effective logger level. |
public static PlatformLogger. |
ALL | back to summary |
---|---|
public static final PlatformLogger. |
CONFIG | back to summary |
---|---|
public static final PlatformLogger. |
FINE | back to summary |
---|---|
public static final PlatformLogger. |
FINER | back to summary |
---|---|
public static final PlatformLogger. |
FINEST | back to summary |
---|---|
public static final PlatformLogger. |
INFO | back to summary |
---|---|
public static final PlatformLogger. |
LEVEL_VALUES | back to summary |
---|---|
private static final int[] LEVEL_VALUES |
OFF | back to summary |
---|---|
public static final PlatformLogger. |
SEVERE | back to summary |
---|---|
public static final PlatformLogger. |
SEVERITY_ALL | back to summary |
---|---|
private static final int SEVERITY_ALL |
SEVERITY_CONFIG | back to summary |
---|---|
private static final int SEVERITY_CONFIG |
SEVERITY_FINE | back to summary |
---|---|
private static final int SEVERITY_FINE |
SEVERITY_FINER | back to summary |
---|---|
private static final int SEVERITY_FINER |
SEVERITY_FINEST | back to summary |
---|---|
private static final int SEVERITY_FINEST |
SEVERITY_INFO | back to summary |
---|---|
private static final int SEVERITY_INFO |
SEVERITY_OFF | back to summary |
---|---|
private static final int SEVERITY_OFF |
SEVERITY_SEVERE | back to summary |
---|---|
private static final int SEVERITY_SEVERE |
SEVERITY_WARNING | back to summary |
---|---|
private static final int SEVERITY_WARNING |
systemLevel | back to summary |
---|---|
pack-priv final System. |
WARNING | back to summary |
---|---|
public static final PlatformLogger. |
Level | back to summary |
---|---|
private Level(System. |
intValue | back to summary |
---|---|
public int intValue() |
systemLevel | back to summary |
---|---|
public System. |
valueOf | back to summary |
---|---|
public static PlatformLogger. |
valueOf | back to summary |
---|---|
public static PlatformLogger. Maps a severity value to an effective logger level.
|
values | back to summary |
---|---|
public static PlatformLogger. |