Package org.apache.solr.util
Class StartupLoggingUtils
- java.lang.Object
-
- org.apache.solr.util.StartupLoggingUtils
-
public final class StartupLoggingUtils extends Object
Handles programmatic modification of logging during startupWARNING: This class should only be used during startup. For modifying log levels etc during runtime, SLF4J and LogWatcher must be used.
-
-
Constructor Summary
Constructors Constructor Description StartupLoggingUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
changeLogLevel(String logLevel)
Dynamically change log4j log level through property solr.log.levelstatic void
checkLogDir()
Checks whether mandatory log dir is givenstatic String
getLoggerImplStr()
static String
getLogLevelString()
Return a string representing the current static ROOT logging levelstatic boolean
muteConsole()
Disables all log4j2 ConsoleAppender's by modifying log4j configuration dynamically.
-
-
-
Method Detail
-
checkLogDir
public static void checkLogDir()
Checks whether mandatory log dir is given
-
getLoggerImplStr
public static String getLoggerImplStr()
-
muteConsole
public static boolean muteConsole()
Disables all log4j2 ConsoleAppender's by modifying log4j configuration dynamically. Must only be used during early startup- Returns:
- true if ok or else false if something happened, e.g. log4j2 classes were not in classpath
-
changeLogLevel
public static boolean changeLogLevel(String logLevel)
Dynamically change log4j log level through property solr.log.level- Parameters:
logLevel
- String with level, should be one of the supported, e.g. TRACE, DEBUG, INFO, WARN, ERROR...- Returns:
- true if ok or else false if something happened, e.g. log4j classes were not in classpath
-
getLogLevelString
public static String getLogLevelString()
Return a string representing the current static ROOT logging level- Returns:
- a string TRACE, DEBUG, WARN, ERROR or INFO representing current log level. Default is INFO
-
-