You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Sharan Venugopal <sh...@yahoo.com> on 2002/11/11 21:08:30 UTC
TestClient I used for the missing messages
Following is the TestClient code, which helped me
simulate the Log message missing scenario.
package com.indus.insite.util.Logger.client;
import com.indus.insite.util.Logger.LogService;
import com.indus.insite.util.Logger.LogServiceFactory;
public class TestLogger
{
public TestLogger()
{
}
static LogService logService =
LogServiceFactory.getLogService(TestLogger.class);
public static void main(String [] args)
{
System.out.println("Got Logger : " + logService);
logService.configureAndWatchUsingProperty("c:\\test.properties",
10);
//logService.setLevel(LogServiceFactory.ERROR);
//logService.setLevel(50000);
System.out.println("Got Logger Level: " +
logService.getLevelName());
System.out.println("Got Logger Level: " +
logService.getLevel());
System.out.println("Got Logger Name: " +
logService.getLoggerName());
//logService.error("Test Logging");
loadLogger(logService);
}
public static void loadLogger(LogService logService)
{
long l1 = System.currentTimeMillis();
for(int i=0;i<1000;i++)
{
try{ Thread.sleep(100); }catch(Exception e){}
logService.debug("Test : " + i);
logService.info("Test : " + i);
logService.warn("Test : " + i);
logService.error("Test : " + i);
logService.fatal("Test : " + i);
}
long l2 = System.currentTimeMillis();
System.out.println("Time taken to Log : " + (l2
-l1));
}
// logService.
}
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>