Search in sources :

Example 1 with TTCCLayout

use of org.apache.log4j.TTCCLayout in project wso2-axis2-transports by wso2.

the class LogManager method setTestCase.

public void setTestCase(ManagedTestCase testCase) throws IOException {
    if (appender != null) {
        Logger.getRootLogger().removeAppender(appender);
        appender.close();
        appender = null;
    }
    if (logs != null) {
        for (OutputStream log : logs) {
            IOUtils.closeQuietly(log);
        }
        logs = null;
    }
    if (testCase == null) {
        testCaseDir = null;
    } else {
        File testSuiteDir = new File(logDir, testCase.getTestClass().getName());
        testCaseDir = new File(testSuiteDir, testCase.getId());
        logs = new LinkedList<OutputStream>();
        sequence = 1;
        appender = new WriterAppender(new TTCCLayout(), createLog("debug"));
        Logger.getRootLogger().addAppender(appender);
    }
}
Also used : OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) TTCCLayout(org.apache.log4j.TTCCLayout) WriterAppender(org.apache.log4j.WriterAppender) File(java.io.File)

Aggregations

File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 OutputStream (java.io.OutputStream)1 TTCCLayout (org.apache.log4j.TTCCLayout)1 WriterAppender (org.apache.log4j.WriterAppender)1