Package java.util.logging

Examples of java.util.logging.Logger


    setLogLevel(namespace, Level.parse(level));
  }

 
  public static void setLogLevel(String namespace, Level level) {
    Logger logger = Logger.getLogger(namespace);
    logger.setLevel(level);

    ConsoleHandler ch = new ConsoleHandler();
    ch.setLevel(level);
    ch.setFormatter(new LogFormatter());
    logger.addHandler(ch);   
  }
View Full Code Here


    setLogLevel(namespace, Level.parse(level));
  }

 
  public static void setLogLevel(String namespace, Level level) {
    Logger logger = Logger.getLogger(namespace);
    logger.setLevel(level);

    ConsoleHandler ch = new ConsoleHandler();
    ch.setLevel(level);
    ch.setFormatter(new LogFormatter());
    logger.addHandler(ch);   
  }
View Full Code Here

            File log = new File(logPattern.substring(0, stripPos));
            if (!log.isAbsolute()) log = new File(dataPath, log.getPath());
            if (!log.canRead()) log.mkdir();

            // generating the root logger
            final Logger logger = Logger.getLogger("");
            logger.setUseParentHandlers(false);

            //for (Handler h: logger.getHandlers()) logger.removeHandler(h);
            if (!dataPath.getAbsolutePath().equals(appPath.getAbsolutePath())) {
                final FileHandler handler = new FileHandler(logPattern, 1024*1024, 20, true);
                logger.addHandler(handler);
            }

            // redirect uncaught exceptions to logging
            final Log exceptionLog = new Log("UNCAUGHT-EXCEPTION");
            Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
View Full Code Here

  @Test
  public void testHttpClientWithAuthMissingPassword() throws Exception {
   
    System.out.println("testHttpClientWithAuthMissingPassword");

    Logger LOG = Logger.getLogger("org.xlightweb.test");
   
    LOG.fine("start proxy");
    HttpProxy2 proxy = new HttpProxy2(true);
    proxy.start();
   
   
    HttpClient httpClient = new HttpClient();
    httpClient.setProxyHost("localhost");
    httpClient.setProxyPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
   

    try {
      LOG.fine("call");
      httpClient.call(new GetRequest("http://www.amazon.de/"));
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
   
    LOG.fine("returned");
    httpClient.close();
    proxy.close();
 
View Full Code Here

  @Test
  public void testHttpClientWithAuthMissingPassword() throws Exception {
   
    System.out.println("testHttpClientWithAuthMissingPassword");

    Logger LOG = Logger.getLogger("org.xlightweb.test");
   
    LOG.fine("start proxy");
    HttpProxy2 proxy = new HttpProxy2(true);
    proxy.start();
   
   
    HttpClient httpClient = new HttpClient();
    httpClient.setProxyHost("localhost");
    httpClient.setProxyPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
   

    try {
      LOG.fine("call");
      httpClient.call(new GetRequest("http://www.amazon.de/"));
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
   
    LOG.fine("returned");
    httpClient.close();
    proxy.close();
 
View Full Code Here

  @Test
  public void testHttpClientWithAuthMissingPassword() throws Exception {
   
    System.out.println("testHttpClientWithAuthMissingPassword");

    Logger LOG = Logger.getLogger("org.xlightweb.test");
   
    LOG.fine("start proxy");
    HttpProxy2 proxy = new HttpProxy2(true);
    proxy.start();
   
   
    HttpClient httpClient = new HttpClient();
    httpClient.setProxyHost("localhost");
    httpClient.setProxyPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
   

    try {
      LOG.fine("call");
      httpClient.call(new GetRequest("http://www.amazon.de/"));
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
   
    LOG.fine("returned");
    httpClient.close();
    proxy.close();
 
View Full Code Here

  @Test
  public void testHttpClientWithAuthMissingPassword() throws Exception {
   
    System.out.println("testHttpClientWithAuthMissingPassword");

    Logger LOG = Logger.getLogger("org.xlightweb.test");
   
    LOG.fine("start proxy");
    HttpProxy2 proxy = new HttpProxy2(true);
    proxy.start();
   
   
    HttpClient httpClient = new HttpClient();
    httpClient.setProxyHost("localhost");
    httpClient.setProxyPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
   

    try {
      LOG.fine("call");
      httpClient.call(new GetRequest("http://www.amazon.de/"));
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
   
    LOG.fine("returned");
    httpClient.close();
    proxy.close();
 
View Full Code Here

  @Test
  public void testHttpClientWithAuthMissingPassword() throws Exception {
   
    System.out.println("testHttpClientWithAuthMissingPassword");

    Logger LOG = Logger.getLogger("org.xlightweb.test");
   
    LOG.fine("start proxy");
    HttpProxy2 proxy = new HttpProxy2(true);
    proxy.start();
   
   
    HttpClient httpClient = new HttpClient();
    httpClient.setProxyHost("localhost");
    httpClient.setProxyPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
   

    try {
      LOG.fine("call");
      httpClient.call(new GetRequest("http://www.amazon.de/"));
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
   
    LOG.fine("returned");
    httpClient.close();
    proxy.close();
 
View Full Code Here

  @Test
  public void testHttpClientWithAuthMissingPassword() throws Exception {
   
    System.out.println("testHttpClientWithAuthMissingPassword");

    Logger LOG = Logger.getLogger("org.xlightweb.test");
   
    LOG.fine("start proxy");
    HttpProxy2 proxy = new HttpProxy2(true);
    proxy.start();
   
   
    HttpClient httpClient = new HttpClient();
    httpClient.setProxyHost("localhost");
    httpClient.setProxyPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
   

    try {
      LOG.fine("call");
      httpClient.call(new GetRequest("http://www.amazon.de/"));
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
   
    LOG.fine("returned");
    httpClient.close();
    proxy.close();
 
View Full Code Here

*/
public final class HttpClientRetryTest {

    public static void main(String[] args) throws Exception {
       
        Logger LOG = Logger.getLogger(HttpClientRetryTest.class.getName());
       
        for (int i = 0; i < 10000; i++) {
            LOG.info("loop " + i);
            new HttpClientRetryTest().testSimpleGetRetry();
        }
    }
View Full Code Here

TOP

Related Classes of java.util.logging.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.