org.pentaho.di.core.logging
Class LogChannelFileWriter

java.lang.Object
  extended by 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

Constructor Summary
LogChannelFileWriter(String logChannelId, org.apache.commons.vfs.FileObject logFile, boolean appending)
          Create a new log channel file writer
LogChannelFileWriter(String logChannelId, org.apache.commons.vfs.FileObject logFile, boolean appending, int pollingInterval)
          Create a new log channel file writer
 
Method Summary
 KettleException getException()
           
 String getLogChannelId()
           
 org.apache.commons.vfs.FileObject getLogFile()
           
 int getPollingInterval()
           
 boolean isAppending()
           
 void setAppending(boolean appending)
           
 void setLogChannelId(String logChannelId)
           
 void setLogFile(org.apache.commons.vfs.FileObject logFile)
           
 void setPollingInterval(int pollingInterval)
           
 void startLogging()
          Start the logging thread which will write log data from the specified log channel to the log file.
 void stopLogging()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogChannelFileWriter

public LogChannelFileWriter(String logChannelId,
                            org.apache.commons.vfs.FileObject logFile,
                            boolean appending,
                            int pollingInterval)
                     throws KettleException
Create a new log channel file writer

Parameters:
logChannelId - The log channel (+children) to write to the log file
logFile - The logging file to write to
appending - set to true if you want to append to an existing file
pollingInterval - The polling interval in milliseconds.
Throws:
KettleException - in case the specified log file can't be created.

LogChannelFileWriter

public LogChannelFileWriter(String logChannelId,
                            org.apache.commons.vfs.FileObject logFile,
                            boolean appending)
                     throws KettleException
Create a new log channel file writer

Parameters:
logChannelId - The log channel (+children) to write to the log file
logFile - The logging file to write to
appending - set to true if you want to append to an existing file
Throws:
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().


stopLogging

public void stopLogging()

getException

public 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.vfs.FileObject getLogFile()
Returns:
the logFile

setLogFile

public void setLogFile(org.apache.commons.vfs.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