public class LogUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LogUtils.LogInitializationException |
Modifier and Type | Field and Description |
---|---|
static String |
OPERATIONLOG_LEVEL_KEY |
static String |
QUERYID_LOG_KEY |
static String |
SESSIONID_LOG_KEY
Constants of the key strings for the logging ThreadContext.
|
Constructor and Description |
---|
LogUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkAndSetAsyncLogging(org.apache.hadoop.conf.Configuration conf) |
static String |
initHiveExecLog4j()
Initialize log4j for execution mode.
|
static String |
initHiveLog4j()
Initialize log4j.
|
static String |
initHiveLog4jCommon(HiveConf conf,
HiveConf.ConfVars confVarName) |
static String |
maskIfPassword(String key,
String value)
Returns MASKED_VALUE if the key contains KEY_TO_MASK_WITH or the original property otherwise.
|
static void |
registerLoggingContext(org.apache.hadoop.conf.Configuration conf)
Register logging context so that log system can print QueryId, SessionId, etc for each message
|
static void |
stopQueryAppender(String routingAppenderName,
String queryId)
Stop the subordinate appender for the operation log so it will not leak a file descriptor.
|
static void |
unregisterLoggingContext()
Unregister logging context
|
public static final String SESSIONID_LOG_KEY
public static final String QUERYID_LOG_KEY
public static final String OPERATIONLOG_LEVEL_KEY
public static String initHiveLog4j() throws LogUtils.LogInitializationException
LogUtils.LogInitializationException
- if log4j fails to initialize correctlypublic static String initHiveExecLog4j() throws LogUtils.LogInitializationException
LogUtils.LogInitializationException
- if log4j-exec fails to initialize correctlypublic static String initHiveLog4jCommon(HiveConf conf, HiveConf.ConfVars confVarName) throws LogUtils.LogInitializationException
public static boolean checkAndSetAsyncLogging(org.apache.hadoop.conf.Configuration conf)
public static String maskIfPassword(String key, String value)
key
- The property key to checkvalue
- The original value of the propertypublic static void registerLoggingContext(org.apache.hadoop.conf.Configuration conf)
public static void unregisterLoggingContext()
public static void stopQueryAppender(String routingAppenderName, String queryId)
routingAppenderName
- the name of the RoutingAppenderqueryId
- the id of the query that is closingCopyright © 2022 The Apache Software Foundation. All rights reserved.