Package org.pentaho.di.core.logging
Class LogChannelFileWriter
- java.lang.Object
-
- org.pentaho.di.core.logging.LogChannelFileWriter
-
public class LogChannelFileWriter extends Object
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
Fields Modifier and Type Field Description protected OutputStreamlogFileOutputStream
-
Constructor Summary
Constructors Constructor Description LogChannelFileWriter(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()org.pentaho.di.core.exception.KettleExceptiongetException()StringgetLogChannelId()org.apache.commons.vfs2.FileObjectgetLogFile()intgetPollingInterval()booleanisAppending()voidsetAppending(boolean appending)voidsetLogChannelId(String logChannelId)voidsetLogFile(org.apache.commons.vfs2.FileObject logFile)voidsetPollingInterval(int pollingInterval)voidstartLogging()Start the logging thread which will write log data from the specified log channel to the log file.voidstopLogging()
-
-
-
Field Detail
-
logFileOutputStream
protected OutputStream logFileOutputStream
-
-
Constructor Detail
-
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 Detail
-
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
public String getLogChannelId()
- Returns:
- the logChannelId
-
setLogChannelId
public void setLogChannelId(String logChannelId)
- 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
-
-