Top Description Fields Constructors Methods
org.apache.logging.log4j.jul

public final Class LevelTranslator

extends Object
Class Inheritance
Imports
org.apache.logging.log4j.Level, .Logger, org.apache.logging.log4j.status.StatusLogger, org.apache.logging.log4j.util.LoaderUtil, .PropertiesUtil

Utility class to convert between JDK Levels and Log4j 2 Levels.
Since
2.1

Field Summary

Modifier and TypeField and Description
public static final Level
CONFIG

Custom Log4j level corresponding to the java.util.logging.Level#CONFIG logging level.

public static final Level
FINEST

Custom Log4j level corresponding to the java.util.logging.Level#FINEST logging level.

private static final LevelConverter
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Level

Returns:

converted Level.
toJavaLevel
(final Level
Log4j Level to convert.
level
)

Converts a Log4j logging Level to a JDK logging Level.

public static Level

Returns:

converted Level or null
toLevel
(final Level
JDK Level to convert, may be null per the JUL specification.
level
)

Converts a JDK logging Level to a Log4j logging Level.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONFIGback to summary
public static final Level CONFIG

Custom Log4j level corresponding to the java.util.logging.Level#CONFIG logging level. This maps to a level in between org.apache.logging.log4j.Level#INFO and org.apache.logging.log4j.Level#DEBUG.

FINESTback to summary
public static final Level FINEST

Custom Log4j level corresponding to the java.util.logging.Level#FINEST logging level. This maps to a level more specific than org.apache.logging.log4j.Level#TRACE.

LEVEL_CONVERTERback to summary
private static final LevelConverter LEVEL_CONVERTER
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

LevelTranslatorback to summary
private LevelTranslator()

Method Detail

toJavaLevelback to summary
public static Level toJavaLevel(final Level level)

Converts a Log4j logging Level to a JDK logging Level.

Parameters
level:Level

Log4j Level to convert.

Returns:Level

converted Level.

toLevelback to summary
public static Level toLevel(final Level level)

Converts a JDK logging Level to a Log4j logging Level.

Parameters
level:Level

JDK Level to convert, may be null per the JUL specification.

Returns:Level

converted Level or null