Search in sources :

Example 16 with XLogUserFilterParam

use of org.apache.oozie.util.XLogUserFilterParam in project oozie by apache.

the class TestXLogUserFilterParam method testloglevel_DEBUF_INFO.

// Test multiple log level
public void testloglevel_DEBUF_INFO() throws Exception {
    setLogFile();
    String logLevel = XLogUserFilterParam.LOG_LEVEL + "=DEBUG|INFO";
    Map<String, String[]> paramMap = new HashMap<String, String[]>();
    paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { logLevel });
    XLogFilter xf = new XLogFilter(new XLogUserFilterParam(paramMap));
    String out = doStreamLog(xf);
    String[] lines = out.split(System.getProperty("line.separator"));
    assertEquals(lines.length, 4);
    assertTrue(lines[1].startsWith("2014-02-27 02:06:49,215 DEBUG CoordActionStartXCommand:545 [pool-2-thread-236] - USER[-] GROUP[-] " + "TOKEN[-] APP[-]"));
    assertTrue(lines[2].startsWith("2014-02-27 02:06:49,215 DEBUG CoordActionStartXCommand:545 [pool-2-thread-236] - USER[-] GROUP[-] " + "TOKEN[-] APP[-] JOB[0601839-140127221758655-oozie-wrkf-C]"));
    assertTrue(lines[3].startsWith("2014-02-27 02:06:49,215 INFO CoordActionStartXCommand:545 [pool-2-thread-236] - USER[-] GROUP[-] " + "TOKEN[-] APP[-] JOB[0601839-140127221758655-oozie-wrkf-C]"));
}
Also used : HashMap(java.util.HashMap) XLogFilter(org.apache.oozie.util.XLogFilter) XLogUserFilterParam(org.apache.oozie.util.XLogUserFilterParam)

Aggregations

XLogFilter (org.apache.oozie.util.XLogFilter)16 XLogUserFilterParam (org.apache.oozie.util.XLogUserFilterParam)16 HashMap (java.util.HashMap)12 File (java.io.File)9 FileOutputStream (java.io.FileOutputStream)9 InputStream (java.io.InputStream)9 Properties (java.util.Properties)9 Services (org.apache.oozie.service.Services)6 Date (java.util.Date)5 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 CommandException (org.apache.oozie.command.CommandException)1 XLogStreamingService (org.apache.oozie.service.XLogStreamingService)1 XLog (org.apache.oozie.util.XLog)1 XLogAuditFilter (org.apache.oozie.util.XLogAuditFilter)1 XLogStreamer (org.apache.oozie.util.XLogStreamer)1