當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。