当前位置: 首页>>代码示例>>Java>>正文


Java Level.OFF属性代码示例

本文整理汇总了Java中org.apache.log4j.Level.OFF属性的典型用法代码示例。如果您正苦于以下问题:Java Level.OFF属性的具体用法?Java Level.OFF怎么用?Java Level.OFF使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.log4j.Level的用法示例。


在下文中一共展示了Level.OFF属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: intToLevel

public static Level intToLevel(int intLevel) {
	switch(intLevel) {
	case TRACE_INFO: return Level.INFO;
	case TRACE_DEBUG: return Level.DEBUG;
	case TRACE_ERROR: return Level.ERROR;
	case TRACE_WARN: return Level.WARN;
	case TRACE_TRACE: return Level.TRACE;
	case TRACE_FATAL: return Level.FATAL;
	}
	return Level.OFF;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:11,代码来源:CommonLoggerLog4j.java

示例2: getLevel

public Level getLevel(int traceLevel) {
     if ( traceLevel == TRACE_INFO ) {
        return Level.INFO;
    } else if ( traceLevel == TRACE_ERROR ) {
        return Level.ERROR;
    } else if ( traceLevel == TRACE_DEBUG) {
        return Level.DEBUG;
    } else if (traceLevel == TRACE_TRACE) {
        return Level.ALL;
    } else {
        return Level.OFF;
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:13,代码来源:LogWriter.java

示例3: main

/**
   * Main entry point for the echo server application. 
   * @param args contains the port number at args[0].
   */
  public static void main(String[] args) {
  	try {
	new LogSetup("logs/client.log", Level.OFF);
	app_KVClient app = new app_KVClient();
	app.run();
} catch (IOException e) {
	System.out.println("Error! Unable to initialize logger!");
	e.printStackTrace();
	System.exit(1);
}
  }
 
开发者ID:yanghanxy,项目名称:CloudDB,代码行数:15,代码来源:app_KVClient.java

示例4: setLogLevel

/**
 * Set logging level to given value. If not explicitly
 * specified, default level is used from *logger* properties file.
 * (As of the time writing - simplelogger.properties is used as default.)
 * <p/>
 * NOTE: SLF4J is not capable of changing log levels programatically!
 * We have to change the System/File property of given underlying logger.
 *
 * @param logLevel logging level to be logger set to
 */
public static void setLogLevel(String logLevel) {
    org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("com.redhat.mqe.jms");
    Level level;
    switch (logLevel.toLowerCase()) {
        case "all":
            level = Level.ALL;
            break;
        case "trace":
            level = Level.TRACE;
            break;
        case "debug":
            level = Level.DEBUG;
            break;
        case "info":
            level = Level.INFO;
            break;
        case "warn":
            level = Level.WARN;
            break;
        case "error":
            level = Level.ERROR;
            break;
        case "fatal":
            level = Level.FATAL;
            break;
        case "off":
            level = Level.OFF;
            break;
        default:
            level = Level.INFO;
    }
    LogManager.getRootLogger().setLevel(level);
    logger.setLevel(level);
}
 
开发者ID:rh-messaging,项目名称:cli-java,代码行数:44,代码来源:Utils.java


注:本文中的org.apache.log4j.Level.OFF属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。