public class TaskLogUtil extends Object
YarnConfiguration.ENABLE_DFS_LOGGING
to true
in
yarn-site.xml. If enabled, then the configured handler class is instantiated
to provide the DFS specific behavior.Constructor and Description |
---|
TaskLogUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getAppender()
Returns the Log4j appender to use depending on whether DFS logging is
enabled or not.
|
static org.apache.hadoop.yarn.conf.YarnConfiguration |
getConf()
Returns the cached default YarnConfiguration object used to initialize
settings.
|
static DFSLoggingHandler |
getDFSLoggingHandler() |
static String |
getPropertyValue(String property)
Returns the property value from cached default YarnConfiguration object.
|
static String |
getPropertyValue(String property,
String defaultValue)
Returns the property value from cached default YarnConfiguration object.
|
static String |
getRollingAppender()
Returns the Log4j rolling appender to use depending on whether DFS logging
is enabled or not.
|
static boolean |
isDfsLoggingEnabled()
Determines if logs should be saved directly in DFS or written to local
file system.
|
static boolean |
isDfsLoggingEnabled(Map<String,String> env)
Determines if logs should be saved directly in DFS or written to local
file system using the given environment.
|
public static DFSLoggingHandler getDFSLoggingHandler()
public static boolean isDfsLoggingEnabled()
YarnConfiguration
to
determine it. To override for specific application, use the overloaded
method.public static boolean isDfsLoggingEnabled(Map<String,String> env)
env
to determine if DFS logging is supported by the
application.env
- environment settings for the applicationpublic static org.apache.hadoop.yarn.conf.YarnConfiguration getConf()
public static String getAppender()
public static String getRollingAppender()
public static String getPropertyValue(String property, String defaultValue)
defaultValue
is returnedCopyright © 2017 Apache Software Foundation. All Rights Reserved.