Package org.elasticsearch.common.logging
Class Loggers
- java.lang.Object
-
- org.elasticsearch.common.logging.Loggers
-
public class Loggers extends java.lang.Object
A set of utilities around Logging.
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<org.apache.logging.log4j.Level>
LOG_DEFAULT_LEVEL_SETTING
static Setting.AffixSetting<org.apache.logging.log4j.Level>
LOG_LEVEL_SETTING
static java.lang.String
SPACE
-
Constructor Summary
Constructors Constructor Description Loggers()
-
Method Summary
Modifier and Type Method Description static void
addAppender(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.core.Appender appender)
static org.apache.logging.log4j.core.Appender
findAppender(org.apache.logging.log4j.Logger logger, java.lang.Class<? extends org.apache.logging.log4j.core.Appender> clazz)
static org.apache.logging.log4j.Logger
getLogger(java.lang.Class<?> clazz, java.lang.String... prefixes)
static org.apache.logging.log4j.Logger
getLogger(java.lang.Class<?> clazz, Index index, java.lang.String... prefixes)
static org.apache.logging.log4j.Logger
getLogger(java.lang.Class<?> clazz, ShardId shardId, java.lang.String... prefixes)
static org.apache.logging.log4j.Logger
getLogger(java.lang.String loggerName, ShardId shardId)
Just likegetLogger(Class, ShardId, String...)
but String loggerName instead of Class and no extra prefixes.static org.apache.logging.log4j.Logger
getLogger(org.apache.logging.log4j.Logger parentLogger, java.lang.String s)
static void
removeAppender(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.core.Appender appender)
static void
setLevel(org.apache.logging.log4j.Logger logger, java.lang.String level)
Set the level of the logger.static void
setLevel(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level)
-
-
-
Field Detail
-
SPACE
public static final java.lang.String SPACE
- See Also:
- Constant Field Values
-
LOG_DEFAULT_LEVEL_SETTING
public static final Setting<org.apache.logging.log4j.Level> LOG_DEFAULT_LEVEL_SETTING
-
LOG_LEVEL_SETTING
public static final Setting.AffixSetting<org.apache.logging.log4j.Level> LOG_LEVEL_SETTING
-
-
Method Detail
-
getLogger
public static org.apache.logging.log4j.Logger getLogger(java.lang.Class<?> clazz, ShardId shardId, java.lang.String... prefixes)
-
getLogger
public static org.apache.logging.log4j.Logger getLogger(java.lang.String loggerName, ShardId shardId)
Just likegetLogger(Class, ShardId, String...)
but String loggerName instead of Class and no extra prefixes.
-
getLogger
public static org.apache.logging.log4j.Logger getLogger(java.lang.Class<?> clazz, Index index, java.lang.String... prefixes)
-
getLogger
public static org.apache.logging.log4j.Logger getLogger(java.lang.Class<?> clazz, java.lang.String... prefixes)
-
getLogger
public static org.apache.logging.log4j.Logger getLogger(org.apache.logging.log4j.Logger parentLogger, java.lang.String s)
-
setLevel
public static void setLevel(org.apache.logging.log4j.Logger logger, java.lang.String level)
Set the level of the logger. If the new level is null, the logger will inherit it's level from its nearest ancestor with a non-null level.
-
setLevel
public static void setLevel(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level)
-
addAppender
public static void addAppender(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.core.Appender appender)
-
removeAppender
public static void removeAppender(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.core.Appender appender)
-
findAppender
public static org.apache.logging.log4j.core.Appender findAppender(org.apache.logging.log4j.Logger logger, java.lang.Class<? extends org.apache.logging.log4j.core.Appender> clazz)
-
-