Package org.pentaho.di.core.logging
Class KettleLogStore
- java.lang.Object
-
- org.pentaho.di.core.logging.KettleLogStore
-
public class KettleLogStore extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static PrintStream
OriginalSystemErr
static PrintStream
OriginalSystemOut
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
discardLines(String parentLogChannelId, boolean includeGeneralMessages)
Discard all the lines for the specified log channel id AND all the children.static LoggingBuffer
getAppender()
static KettleLogStore
getInstance()
static int
getLastBufferLineNr()
static List<KettleLoggingEvent>
getLogBufferFromTo(String parentLogChannelId, boolean includeGeneral, int from, int to)
Get all the log lines pertaining to the specified parent log channel id (including all children)static List<KettleLoggingEvent>
getLogBufferFromTo(List<String> channelId, boolean includeGeneral, int from, int to)
Get all the log lines for the specified parent log channel id (including all children)static LogChannelInterfaceFactory
getLogChannelInterfaceFactory()
static void
init()
static void
init(boolean redirectStdOut, boolean redirectStdErr)
Initialize the central log store with arguments specifying whether to redirect of stdout and stderrstatic void
init(int maxSize, int maxLogTimeoutMinutes)
Initialize the central log store with optional limitation to the sizestatic void
init(int maxSize, int maxLogTimeoutMinutes, boolean redirectStdOut, boolean redirectStdErr)
Initialize the central log store with optional limitation to the size and redirect of stdout and stderrstatic boolean
isInitialized()
void
replaceLogCleaner(int maxLogTimeoutMinutes)
void
reset()
static void
setLogChannelInterfaceFactory(LogChannelInterfaceFactory logChannelInterfaceFactory)
-
-
-
Field Detail
-
OriginalSystemOut
public static PrintStream OriginalSystemOut
-
OriginalSystemErr
public static PrintStream OriginalSystemErr
-
-
Method Detail
-
getLogChannelInterfaceFactory
public static LogChannelInterfaceFactory getLogChannelInterfaceFactory()
-
setLogChannelInterfaceFactory
public static void setLogChannelInterfaceFactory(LogChannelInterfaceFactory logChannelInterfaceFactory)
-
replaceLogCleaner
public void replaceLogCleaner(int maxLogTimeoutMinutes)
-
init
public static void init(int maxSize, int maxLogTimeoutMinutes, boolean redirectStdOut, boolean redirectStdErr)
Initialize the central log store with optional limitation to the size and redirect of stdout and stderr- Parameters:
maxSize
- the maximum sizemaxLogTimeoutMinutes
- the maximum time that a log line times out in hoursredirectStdOut
- a boolean indicating whether to redirect stdout to the logging frameworkredirectStdErr
- a boolean indicating whether to redirect stderr to the logging framework
-
init
public static void init(int maxSize, int maxLogTimeoutMinutes)
Initialize the central log store with optional limitation to the size- Parameters:
maxSize
- the maximum sizemaxLogTimeoutMinutes
- The maximum time that a log line times out in hours.
-
init
public static void init()
-
init
public static void init(boolean redirectStdOut, boolean redirectStdErr)
Initialize the central log store with arguments specifying whether to redirect of stdout and stderr- Parameters:
redirectStdOut
- a boolean indicating whether to redirect stdout to the logging frameworkredirectStdErr
- a boolean indicating whether to redirect stderr to the logging framework
-
getInstance
public static KettleLogStore getInstance()
-
getLastBufferLineNr
public static int getLastBufferLineNr()
- Returns:
- the number (sequence, 1..N) of the last log line. If no records are present in the buffer, 0 is returned.
-
getLogBufferFromTo
public static List<KettleLoggingEvent> getLogBufferFromTo(String parentLogChannelId, boolean includeGeneral, int from, int to)
Get all the log lines pertaining to the specified parent log channel id (including all children)- Parameters:
parentLogChannelId
- the parent log channel ID to grabincludeGeneral
- include general log linesfrom
-to
-- Returns:
- the log lines found
-
getLogBufferFromTo
public static List<KettleLoggingEvent> getLogBufferFromTo(List<String> channelId, boolean includeGeneral, int from, int to)
Get all the log lines for the specified parent log channel id (including all children)- Parameters:
channelId
- channel IDs to grabincludeGeneral
- include general log linesfrom
-to
-- Returns:
-
getAppender
public static LoggingBuffer getAppender()
- Returns:
- The appender that represents the central logging store. It is capable of giving back log rows in an incremental fashion, etc.
-
discardLines
public static void discardLines(String parentLogChannelId, boolean includeGeneralMessages)
Discard all the lines for the specified log channel id AND all the children.- Parameters:
parentLogChannelId
- the parent log channel id to be removed along with all its children.
-
isInitialized
public static boolean isInitialized()
-
reset
public void reset()
-
-