@PublicAPI public class Log4JTaskLogs extends Object implements TaskLogs
Modifier and Type | Field and Description |
---|---|
static String |
JOB_LOGGER_PREFIX
Prefix for job logger
|
static String |
MDC_HOST
Log4j context variable name for task ids
|
static String |
MDC_JOB_ID |
static String |
MDC_TASK_ID
Log4j context variable name for task ids
|
static String |
MDC_TASK_NAME |
static org.apache.log4j.Level |
STDERR_LEVEL
Logger level in which stderr must be redirected
|
static org.apache.log4j.Level |
STDOUT_LEVEL
Logger level in which stdout must be redirected
|
Constructor and Description |
---|
Log4JTaskLogs()
Hibernate constructor
|
Log4JTaskLogs(LinkedList<org.apache.log4j.spi.LoggingEvent> all,
String jobId)
Create a new Log4JTaskLogs log.
|
Modifier and Type | Method and Description |
---|---|
LinkedList<org.apache.log4j.spi.LoggingEvent> |
getAllEvents()
Return all the currently logged events
|
String |
getAllLogs()
Return all the logs generated on standard and error output.
|
String |
getAllLogs(boolean timeStamp)
Return all the logs generated on standard and error output.
|
static String |
getLoggerName(JobId jobId) |
static String |
getLoggerName(String jobId) |
String |
getStderrLogs()
Return the logs generated on error output.
|
String |
getStderrLogs(boolean timeStamp)
Return the logs generated on error output.
|
String |
getStdoutLogs()
Return the logs generated on standard output.
|
String |
getStdoutLogs(boolean timeStamp)
Return the logs generated on standard output.
|
static org.apache.log4j.Layout |
getTaskLogLayout()
Default layout for logs
|
public static final String JOB_LOGGER_PREFIX
public static final String MDC_JOB_ID
public static final String MDC_TASK_ID
public static final String MDC_TASK_NAME
public static final String MDC_HOST
public static final org.apache.log4j.Level STDOUT_LEVEL
public static final org.apache.log4j.Level STDERR_LEVEL
public Log4JTaskLogs()
public Log4JTaskLogs(LinkedList<org.apache.log4j.spi.LoggingEvent> all, String jobId)
all
- the buffer of logging events.public static org.apache.log4j.Layout getTaskLogLayout()
public String getAllLogs(boolean timeStamp)
TaskLogs
getAllLogs
in interface TaskLogs
timeStamp
- get the logs with or without time tags.TaskLogs.getAllLogs(boolean
timeStamp)
public String getStderrLogs(boolean timeStamp)
TaskLogs
getStderrLogs
in interface TaskLogs
timeStamp
- get the logs with or without time tags.TaskLogs.getStderrLogs(boolean
timeStamp)
public String getStdoutLogs()
TaskLogs
getStdoutLogs
in interface TaskLogs
public String getStderrLogs()
TaskLogs
getStderrLogs
in interface TaskLogs
public String getAllLogs()
TaskLogs
getAllLogs
in interface TaskLogs
public String getStdoutLogs(boolean timeStamp)
TaskLogs
getStdoutLogs
in interface TaskLogs
timeStamp
- get the logs with or without time tags.TaskLogs.getStdoutLogs(boolean
timeStamp)
public LinkedList<org.apache.log4j.spi.LoggingEvent> getAllEvents()