本文整理汇总了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 */
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}