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


Java Level.ALL属性代码示例

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


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

示例1: 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

示例2: write

@Override
public void write(String loggerName, String filePrefix, String content) {
  RollingFileAppender logger = fileAppenders.computeIfAbsent(loggerName, f -> initLogger(loggerName, filePrefix));
  LoggingEvent event = new LoggingEvent(loggerName, Logger.getLogger(loggerName), Level.ALL,
      content, null);
  logger.append(event);
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:7,代码来源:Log4JMetricsFileWriter.java

示例3: enableDebugLoggingIfRequired

public static boolean enableDebugLoggingIfRequired(
    org.apache.hadoop.conf.Configuration conf) {

  boolean result = false;

  try {

    Level desiredOraOopLoggingLevel =
        Level.toLevel(conf.get(OraOopConstants.ORAOOP_LOGGING_LEVEL),
            Level.INFO);

    Level sqoopLogLevel =
        Logger.getLogger(Sqoop.class.getName()).getParent().getLevel();

    if (desiredOraOopLoggingLevel == Level.DEBUG
        || desiredOraOopLoggingLevel == Level.ALL
        || sqoopLogLevel == Level.DEBUG || sqoopLogLevel == Level.ALL) {

      Category oraOopLogger =
          Logger.getLogger(OraOopManagerFactory.class.getName()).getParent();
      oraOopLogger.setLevel(Level.DEBUG);
      LOG.debug("Enabled OraOop debug logging.");
      result = true;

      conf.set(OraOopConstants.ORAOOP_LOGGING_LEVEL, Level.DEBUG.toString());
    }
  } catch (Exception ex) {
    LOG.error(String.format(
        "Unable to determine whether debug logging should be enabled.\n%s",
        getFullExceptionMessage(ex)));
  }

  return result;
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:34,代码来源:OraOopUtilities.java

示例4: main

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

示例5: 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/server.log", Level.ALL);
    		app_KVServer app_kvserver = new app_KVServer();
			app_kvserver.run(Integer.parseInt(args[0]));
//			app_kvserver.run(50000);			
		} catch (NumberFormatException | IOException nfe) {
			System.out.println("Error! Invalid argument <port> or <cacheSize>! Not a number!");
			System.out.println("Usage: Server <port> <cacheSize> <strategy>!");
			System.exit(1);
		}
    }
 
开发者ID:yanghanxy,项目名称:CloudDB,代码行数:16,代码来源:app_KVServer.java

示例6: MessageBroker

public MessageBroker(String ip, int port){
	changeSubscriberData = new SubscriberData();
	deleteSubscriberData = new SubscriberData();
	keyVerifier = new KVClient(ip, port);
	
	try {
		new LogSetup("logs/broker.log", Level.ALL);
	} catch (IOException e) {
		logger.error("Error!" + e.getMessage());
	}
}
 
开发者ID:yanghanxy,项目名称:CloudDB,代码行数:11,代码来源:MessageBroker.java

示例7: 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

示例8: getThreshold

@Override
public Level getThreshold() {
  return Level.ALL;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:4,代码来源:TestLog4Json.java

示例9: LogCaptorTestBase

public LogCaptorTestBase() {
    super(Level.ALL);
}
 
开发者ID:aws,项目名称:aws-sdk-java-v2,代码行数:3,代码来源:LogCaptor.java


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