org.apache.oozie.util
Class XLogStreamer.Filter

java.lang.Object
  extended by org.apache.oozie.util.XLogStreamer.Filter
Enclosing class:
XLogStreamer

public static class XLogStreamer.Filter
extends Object

Filter that will construct the regular expression that will be used to filter the log statement. And also checks if the given log message go through the filter. Filters that can be used are logLevel(Multi values separated by "|") jobId appName actionId token


Field Summary
static String ALLOW_ALL_REGEX
           
 
Constructor Summary
XLogStreamer.Filter()
           
 
Method Summary
 void constructPattern()
          Constructs the regular expression according to the filter and assigns it to fileterPattarn.
static void defineParameter(String filterParam)
           
 boolean isFilterPresent()
           
 boolean matches(ArrayList<String> logParts)
          Checks if the logLevel and logMessage goes through the logFilter.
static void reset()
           
 void setLogLevel(String logLevel)
           
 void setParameter(String filterParam, String value)
           
 ArrayList<String> splitLogMessage(String logLine)
          Splits the log line into timestamp, logLevel and remaining log message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_ALL_REGEX

public static final String ALLOW_ALL_REGEX
See Also:
Constant Field Values
Constructor Detail

XLogStreamer.Filter

public XLogStreamer.Filter()
Method Detail

setLogLevel

public void setLogLevel(String logLevel)

setParameter

public void setParameter(String filterParam,
                         String value)

defineParameter

public static void defineParameter(String filterParam)

isFilterPresent

public boolean isFilterPresent()

matches

public boolean matches(ArrayList<String> logParts)
Checks if the logLevel and logMessage goes through the logFilter.

Parameters:
logParts -
Returns:

splitLogMessage

public ArrayList<String> splitLogMessage(String logLine)
Splits the log line into timestamp, logLevel and remaining log message. Returns array containing logLevel and logMessage if the pattern matches i.e A new log statement, else returns null.

Parameters:
logLine -
Returns:
Array containing log level and log message

constructPattern

public void constructPattern()
Constructs the regular expression according to the filter and assigns it to fileterPattarn. ".*" will be assigned if no filters are set.


reset

public static void reset()


Copyright © 2012 Apache Software Foundation. All Rights Reserved.