com.qa.framework.library.log4j.ExPatternConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smart-api-framework Show documentation
Show all versions of smart-api-framework Show documentation
Support web service api automaton test based on testng and httpclient
package com.qa.framework.library.log4j;
import org.apache.log4j.helpers.FormattingInfo;
import org.apache.log4j.helpers.PatternConverter;
import org.apache.log4j.spi.LoggingEvent;
/**
* Created by kcgw001 on 2016/2/22.
*/
public class ExPatternConverter extends PatternConverter {
/**
* Instantiates a new Ex pattern converter.
*
* @param fi the fi
*/
public ExPatternConverter(FormattingInfo fi) {
super(fi);
}
/**
* 当需要显示线程ID的时候,返回当前调用线程的ID
*/
@Override
protected String convert(LoggingEvent event) {
return String.valueOf(Thread.currentThread().getId());
}
}