本文整理匯總了Java中org.apache.log4j.ConsoleAppender.SYSTEM_OUT屬性的典型用法代碼示例。如果您正苦於以下問題:Java ConsoleAppender.SYSTEM_OUT屬性的具體用法?Java ConsoleAppender.SYSTEM_OUT怎麽用?Java ConsoleAppender.SYSTEM_OUT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.log4j.ConsoleAppender
的用法示例。
在下文中一共展示了ConsoleAppender.SYSTEM_OUT屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createAppender
protected Appender createAppender() {
return new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT);
}
示例2: createConsoleAppender
/**
* Creates console appender with some reasonable default logging settings.
*
* @param maxLevel Max logging level.
* @return New console appender.
*/
private Appender createConsoleAppender(Level maxLevel) {
String fmt = "[%d{ISO8601}][%-5p][%t][%c{1}] %m%n";
// Configure output that should go to System.out
Appender app = new ConsoleAppender(new PatternLayout(fmt), ConsoleAppender.SYSTEM_OUT);
LevelRangeFilter lvlFilter = new LevelRangeFilter();
lvlFilter.setLevelMin(Level.TRACE);
lvlFilter.setLevelMax(maxLevel);
app.addFilter(lvlFilter);
return app;
}