Package org.pentaho.di.core.logging
Class LogChannelFileWriter
java.lang.Object
org.pentaho.di.core.logging.LogChannelFileWriter
This class takes care of polling the central log store for new log messages belonging to a certain log channel ID
(and children). The log lines will be written to a logging file.
- Author:
- matt
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLogChannelFileWriter
(String logChannelId, org.apache.commons.vfs2.FileObject logFile, boolean appending) Create a new log channel file writerLogChannelFileWriter
(String logChannelId, org.apache.commons.vfs2.FileObject logFile, boolean appending, int pollingInterval) Create a new log channel file writer -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
org.pentaho.di.core.exception.KettleException
org.apache.commons.vfs2.FileObject
int
boolean
void
setAppending
(boolean appending) void
setLogChannelId
(String logChannelId) void
setLogFile
(org.apache.commons.vfs2.FileObject logFile) void
setPollingInterval
(int pollingInterval) void
Start the logging thread which will write log data from the specified log channel to the log file.void
-
Field Details
-
logFileOutputStream
-
-
Constructor Details
-
LogChannelFileWriter
public LogChannelFileWriter(String logChannelId, org.apache.commons.vfs2.FileObject logFile, boolean appending, int pollingInterval) throws org.pentaho.di.core.exception.KettleException Create a new log channel file writer- Parameters:
logChannelId
- The log channel (+children) to write to the log filelogFile
- The logging file to write toappending
- set to true if you want to append to an existing filepollingInterval
- The polling interval in milliseconds.- Throws:
org.pentaho.di.core.exception.KettleException
- in case the specified log file can't be created.
-
LogChannelFileWriter
public LogChannelFileWriter(String logChannelId, org.apache.commons.vfs2.FileObject logFile, boolean appending) throws org.pentaho.di.core.exception.KettleException Create a new log channel file writer- Parameters:
logChannelId
- The log channel (+children) to write to the log filelogFile
- The logging file to write toappending
- set to true if you want to append to an existing file- Throws:
org.pentaho.di.core.exception.KettleException
- in case the specified log file can't be created.
-
-
Method Details
-
startLogging
public void startLogging()Start the logging thread which will write log data from the specified log channel to the log file. In case of an error, the exception will be available with method getException(). -
flush
public void flush() -
stopLogging
public void stopLogging() -
getException
public org.pentaho.di.core.exception.KettleException getException() -
getLogChannelId
- Returns:
- the logChannelId
-
setLogChannelId
- Parameters:
logChannelId
- the logChannelId to set
-
getLogFile
public org.apache.commons.vfs2.FileObject getLogFile()- Returns:
- the logFile
-
setLogFile
public void setLogFile(org.apache.commons.vfs2.FileObject logFile) - Parameters:
logFile
- the logFile to set
-
isAppending
public boolean isAppending()- Returns:
- the appending
-
setAppending
public void setAppending(boolean appending) - Parameters:
appending
- the appending to set
-
getPollingInterval
public int getPollingInterval()- Returns:
- the pollingInterval
-
setPollingInterval
public void setPollingInterval(int pollingInterval) - Parameters:
pollingInterval
- the pollingInterval to set
-