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


Java Level.name方法代码示例

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


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

示例1: setLogLevel

import org.apache.logging.log4j.Level; //导入方法依赖的package包/类
/**
 * Set the log level for the logger on another node
 *
 * @param p_logLevel
 *         Log level to set.
 * @param p_nodeId
 *         Id of the node to change the log level on
 */
private void setLogLevel(final Level p_logLevel, final Short p_nodeId) {
    if (m_boot.getNodeID() == p_nodeId) {
        setLogLevel(p_logLevel);
    } else {
        SetLogLevelMessage message = new SetLogLevelMessage(p_nodeId, p_logLevel.name());
        try {
            m_network.sendMessage(message);
        } catch (final NetworkException e) {
            // #if LOGGER >= ERROR
            LOGGER.error("Setting log level of node 0x%X failed: %s", p_nodeId, e);
            // #endif /* LOGGER >= ERROR */
        }
    }
}
 
开发者ID:hhu-bsinfo,项目名称:dxram,代码行数:23,代码来源:LoggerService.java

示例2: writeSimpleConfigFile

import org.apache.logging.log4j.Level; //导入方法依赖的package包/类
private static String writeSimpleConfigFile(final File configFile, final Level level)
    throws IOException {
  final String xml =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<Configuration monitorInterval=\"5\">"
          + "<Appenders><Console name=\"STDOUT\" target=\"SYSTEM_OUT\"/></Appenders>"
          + "<Loggers>" + "<Logger name=\"" + TEST_LOGGER_NAME + "\" level=\"" + level.name()
          + "\" additivity=\"true\">" + "<AppenderRef ref=\"STDOUT\"/>" + "</Logger>"
          + "<Root level=\"FATAL\"/>" + "</Loggers>" + "</Configuration>";
  final BufferedWriter writer = new BufferedWriter(new FileWriter(configFile));
  writer.write(xml);
  writer.close();
  return xml;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:14,代码来源:FastLoggerIntegrationJUnitTest.java

示例3: writeLoggerFilterConfigFile

import org.apache.logging.log4j.Level; //导入方法依赖的package包/类
private static String writeLoggerFilterConfigFile(final File configFile, final Level level)
    throws IOException {
  final String xml =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<Configuration monitorInterval=\"5\">"
          + "<Appenders><Console name=\"STDOUT\" target=\"SYSTEM_OUT\"/></Appenders>"
          + "<Loggers>" + "<Logger name=\"" + TEST_LOGGER_NAME + "\" level=\"" + level.name()
          + "\" additivity=\"true\">" + "<filters>" + "<MarkerFilter marker=\""
          + ENABLED_MARKER_NAME + "\" onMatch=\"ACCEPT\" onMismatch=\"DENY\"/>" + "</filters>"
          + "<AppenderRef ref=\"STDOUT\"/>" + "</Logger>" + "<Root level=\"FATAL\"/>"
          + "</Loggers>" + "</Configuration>";
  final BufferedWriter writer = new BufferedWriter(new FileWriter(configFile));
  writer.write(xml);
  writer.close();
  return xml;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:FastLoggerIntegrationJUnitTest.java

示例4: writeContextWideFilterConfigFile

import org.apache.logging.log4j.Level; //导入方法依赖的package包/类
private static String writeContextWideFilterConfigFile(final File configFile, final Level level)
    throws IOException {
  final String xml =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<Configuration monitorInterval=\"5\">"
          + "<Appenders><Console name=\"STDOUT\" target=\"SYSTEM_OUT\"/></Appenders>"
          + "<Loggers>" + "<Logger name=\"" + TEST_LOGGER_NAME + "\" level=\"" + level.name()
          + "\" additivity=\"true\">" + "</Logger>" + "<Root level=\"FATAL\">"
          + "<AppenderRef ref=\"STDOUT\"/>" + "</Root>" + "</Loggers>" + "<filters>"
          + "<MarkerFilter marker=\"" + ENABLED_MARKER_NAME
          + "\" onMatch=\"ACCEPT\" onMismatch=\"DENY\"/>" + "</filters>" + "</Configuration>";
  final BufferedWriter writer = new BufferedWriter(new FileWriter(configFile));
  writer.write(xml);
  writer.close();
  return xml;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:FastLoggerIntegrationJUnitTest.java

示例5: writeAppenderFilterConfigFile

import org.apache.logging.log4j.Level; //导入方法依赖的package包/类
private static String writeAppenderFilterConfigFile(final File configFile, final Level level)
    throws IOException {
  final String xml =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<Configuration monitorInterval=\"5\">"
          + "<Appenders>" + "<Console name=\"STDOUT\" target=\"SYSTEM_OUT\">" + "<filters>"
          + "<MarkerFilter marker=\"" + ENABLED_MARKER_NAME
          + "\" onMatch=\"ACCEPT\" onMismatch=\"DENY\"/>" + "</filters>" + "</Console>"
          + "</Appenders>" + "<Loggers>" + "<Logger name=\"" + TEST_LOGGER_NAME + "\" level=\""
          + level.name() + "\" additivity=\"true\">" + "</Logger>" + "<Root level=\"FATAL\">"
          + "<AppenderRef ref=\"STDOUT\"/>" + "</Root>" + "</Loggers>" + "</Configuration>";
  final BufferedWriter writer = new BufferedWriter(new FileWriter(configFile));
  writer.write(xml);
  writer.close();
  return xml;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:FastLoggerIntegrationJUnitTest.java

示例6: writeAppenderRefFilterConfigFile

import org.apache.logging.log4j.Level; //导入方法依赖的package包/类
private static String writeAppenderRefFilterConfigFile(final File configFile, final Level level)
    throws IOException {
  final String xml =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<Configuration monitorInterval=\"5\">"
          + "<Appenders>" + "<Console name=\"STDOUT\" target=\"SYSTEM_OUT\">" + "</Console>"
          + "</Appenders>" + "<Loggers>" + "<Logger name=\"" + TEST_LOGGER_NAME + "\" level=\""
          + level.name() + "\" additivity=\"true\">" + "</Logger>" + "<Root level=\"FATAL\">"
          + "<AppenderRef ref=\"STDOUT\">" + "<filters>" + "<MarkerFilter marker=\""
          + ENABLED_MARKER_NAME + "\" onMatch=\"ACCEPT\" onMismatch=\"DENY\"/>" + "</filters>"
          + "</AppenderRef>" + "</Root>" + "</Loggers>" + "</Configuration>";
  final BufferedWriter writer = new BufferedWriter(new FileWriter(configFile));
  writer.write(xml);
  writer.close();
  return xml;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:FastLoggerIntegrationJUnitTest.java


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