本文整理匯總了Java中ch.qos.logback.classic.Level.TRACE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Level.TRACE屬性的具體用法?Java Level.TRACE怎麽用?Java Level.TRACE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類ch.qos.logback.classic.Level
的用法示例。
在下文中一共展示了Level.TRACE屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
static int execute(JetGatlingOptions options) {
String workingDir = System.getProperty("user.dir");
GatlingPropertiesBuilder builder = new GatlingPropertiesBuilder();
builder.simulationClass(SIMULATION);
builder.dataDirectory(workingDir);
builder.bodiesDirectory(workingDir);
builder.mute();
if (options.getTimeout() > -1) {
System.setProperty("gatling.http.ahc.readTimeout", String.valueOf(options.getTimeout()));
}
if (options.isDebug() || options.isTrace()) {
Level logLevel = options.isTrace() ? Level.TRACE : Level.DEBUG;
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
loggerContext.getLogger("io.gatling.http.ahc").setLevel(logLevel);
loggerContext.getLogger("io.gatling.http.response").setLevel(logLevel);
loggerContext.getLogger("io.gatling.app").setLevel(logLevel);
loggerContext.getLogger("com.github.scw1109.jetgatling").setLevel(logLevel);
}
return Gatling.fromMap(builder.build());
}
示例2: setLogLevel
/**
* This method sets the log level (logback).
*/
public void setLogLevel() {
logLevel = System.getProperty("logLevel", LOG_LEVEL_INFO);
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
Level logLevelSetting;
switch (logLevel.toLowerCase()) {
case LOG_LEVEL_ERROR:
logLevelSetting = Level.ERROR;
break;
case LOG_LEVEL_WARN:
logLevelSetting = Level.WARN;
break;
case LOG_LEVEL_ALL:
logLevelSetting = Level.ALL;
break;
case LOG_LEVEL_TRACE_LOG:
logLevelSetting = Level.TRACE;
break;
case LOG_LEVEL_INFO:
logLevelSetting = Level.INFO;
break;
case LOG_LEVEL_DEBUG:
logLevelSetting = Level.DEBUG;
break;
default:
logLevelSetting = Level.INFO;
break;
}
root.setLevel(logLevelSetting);
}