public class TaskLogUtil
extends java.lang.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 | Description |
|---|---|
TaskLogUtil() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.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 java.lang.String |
getPropertyValue(java.lang.String property) |
Returns the property value from cached default YarnConfiguration object.
|
static java.lang.String |
getPropertyValue(java.lang.String property,
java.lang.String defaultValue) |
Returns the property value from cached default YarnConfiguration object.
|
static java.lang.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(java.util.Map<java.lang.String,java.lang.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(java.util.Map<java.lang.String,java.lang.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 java.lang.String getAppender()
public static java.lang.String getRollingAppender()
public static java.lang.String getPropertyValue(java.lang.String property,
java.lang.String defaultValue)
defaultValue
is returnedpublic static java.lang.String getPropertyValue(java.lang.String property)
null otherwiseCopyright © 2008–2025 Apache Software Foundation. All rights reserved.