Class 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 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 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:
        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 file
        logFile - The logging file to write to
        appending - 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