public
void testHierarchy1() {
Hierarchy h = new Hierarchy(new RootLogger((Level) Level.ERROR));
Logger a0 = h.getLogger("a");
assertEquals("a", a0.getName());
assertNull(a0.getLevel());
assertSame(Level.ERROR, a0.getEffectiveLevel());
Logger a1 = h.getLogger("a");
assertSame(a0, a1);
}
java类org.apache.log4j.spi.RootLogger的实例源码
LoggerTestCase.java 文件源码
项目:cacheonix-core
阅读 21
收藏 0
点赞 0
评论 0
SocketServer.java 文件源码
项目:daq-eclipse
阅读 25
收藏 0
点赞 0
评论 0
LoggerRepository configureHierarchy(InetAddress inetAddress) {
cat.info("Locating configuration file for "+inetAddress);
// We assume that the toSting method of InetAddress returns is in
// the format hostname/d1.d2.d3.d4 e.g. torino/192.168.1.1
String s = inetAddress.toString();
int i = s.indexOf("/");
if(i == -1) {
cat.warn("Could not parse the inetAddress ["+inetAddress+
"]. Using default hierarchy.");
return genericHierarchy();
} else {
String key = s.substring(0, i);
File configFile = new File(dir, key+CONFIG_FILE_EXT);
if(configFile.exists()) {
Hierarchy h = new Hierarchy(new RootLogger(Level.DEBUG));
hierarchyMap.put(inetAddress, h);
new PropertyConfigurator().doConfigure(configFile.getAbsolutePath(), h);
return h;
} else {
cat.warn("Could not find config file ["+configFile+"].");
return genericHierarchy();
}
}
}
DataFormatterTest.java 文件源码
项目:pentaho-metadata
阅读 25
收藏 0
点赞 0
评论 0
@Before
public void setUp() {
RootLogger.getRootLogger().setLevel( Level.OFF );
SimpleDateFormat format = new SimpleDateFormat( SAMPLE_DATE_MASK );
//add custom seconds
int seconds = 123456;
sampleJavaDate = new Date( seconds );
sampleSqlDate = new java.sql.Date( seconds );
sampleSqlTimeStamp = new Timestamp( seconds );
sampleStringDate = format.format( sampleJavaDate );
expectedDate = format.format( sampleJavaDate );
}
AppRespositorySelector.java 文件源码
项目:t4f-data
阅读 19
收藏 0
点赞 0
评论 0
public static synchronized void init(ServletContext servletContext)
throws ServletException {
if (!initialized) // set the global RepositorySelector
{
defaultRepository = LoggerFactory.getLoggerRepository();
RepositorySelector theSelector = new AppRespositorySelector();
LogManager.setRepositorySelector(theSelector, guard);
initialized = true;
}
Hierarchy hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
loadLog4JConfig(servletContext, hierarchy);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
repositories.put(loader, hierarchy);
}
LoggingRulesTest.java 文件源码
项目:FSTestTools
阅读 26
收藏 0
点赞 0
评论 0
@BeforeClass
public static void setUp() throws Exception {
RootLogger.getRootLogger().addAppender(appenderForTest);
}
LoggingRulesTest.java 文件源码
项目:FSTestTools
阅读 19
收藏 0
点赞 0
评论 0
@AfterClass
public static void tearDown() throws Exception {
assertThat("Expect ending message", appenderForTest.getMessage(), is("Successful termination of 'testLogging'!"));
RootLogger.getRootLogger().removeAppender(appenderForTest);
}
LoggingEventProcessor.java 文件源码
项目:scheduling
阅读 25
收藏 0
点赞 0
评论 0
public NoWarningHierarchy() {
super(new RootLogger(Level.ALL));
}
FetchCommandTest.java 文件源码
项目:rrdclient
阅读 20
收藏 0
点赞 0
评论 0
@BeforeClass
public static void setUpBeforeClass() throws Exception {
BasicConfigurator.configure();
RootLogger.getRootLogger().setLevel(DEBUG);
}
GraphCommandTest.java 文件源码
项目:rrdclient
阅读 23
收藏 0
点赞 0
评论 0
@BeforeClass
public static void setUpBeforeClass() throws Exception {
BasicConfigurator.configure();
RootLogger.getRootLogger().setLevel(DEBUG);
}
CommuneLogger.java 文件源码
项目:commune
阅读 21
收藏 0
点赞 0
评论 0
public CommuneLogger(Class<?> clazz) {
logger = RootLogger.getLogger(clazz);
}
CommuneLogger.java 文件源码
项目:commune
阅读 16
收藏 0
点赞 0
评论 0
public CommuneLogger(Class<?> clazz, String containerId) {
logger = RootLogger.getLogger(clazz);
this.containerId = containerId;
}
CommuneLogger.java 文件源码
项目:commune
阅读 28
收藏 0
点赞 0
评论 0
CommuneLogger(String category) {
logger = RootLogger.getLogger(category);
}
CommuneLogger.java 文件源码
项目:commune
阅读 24
收藏 0
点赞 0
评论 0
public CommuneLogger(String category, String containerId) {
logger = RootLogger.getLogger(category);
this.containerId = containerId;
}