Example usage for java.util.logging Level OFF

List of usage examples for java.util.logging Level OFF

Introduction

In this page you can find the example usage for java.util.logging Level OFF.

Prototype

Level OFF

To view the source code for java.util.logging Level OFF.

Click Source Link

Document

OFF is a special level that can be used to turn off logging.

Usage

From source file:org.mili.core.logging.java.JavaAdapter.java

boolean isOn() {
    return logger.getLevel() != Level.OFF;
}

From source file:hudson.plugins.vcloud.VCDConnection.java

private void init() throws KeyManagementException, UnrecoverableKeyException {
    final String url = Configuration.getProperties().getString(ConfigConstants.VCD_WS_URL.getValue());
    final String username = Configuration.getProperties().getString(ConfigConstants.VCD_WS_USER.getValue());
    final String password = Configuration.getProperties().getString(ConfigConstants.VCD_WS_PASSWORD.getValue());
    VcloudClient.setLogLevel(Level.OFF);
    client = new VcloudClient(url, Version.V5_1);
    try {/*w  ww .  ja  v  a 2 s .  c  om*/
        client.registerScheme("https", 443, FakeSSLSocketFactory.getInstance());
        lastLoggedIn = new Date();
        client.login(username, password);
        client.setMaxConnections(MAX_CONS);
        log.info("Logged IN against VCD instance:  " + username + " @ " + url);
    } catch (VCloudException ex) {
        Logger.getLogger(VCDConnection.class.getName()).log(Level.SEVERE, null, ex);
    } catch (NoSuchAlgorithmException ex) {
        Logger.getLogger(VCDConnection.class.getName()).log(Level.SEVERE, null, ex);
    } catch (KeyStoreException ex) {
        Logger.getLogger(VCDConnection.class.getName()).log(Level.SEVERE, null, ex);
    }

    //| UnrecoverableKeyException
    //   | NoSuchAlgorithmException | KeyStoreException
    // | VCloudException e
}

From source file:io.symcpe.hendrix.api.dao.TestRulesManager.java

@BeforeClass
public static void beforeClass() throws Exception {
    java.util.logging.Logger.getLogger("org.hibernate").setLevel(Level.OFF);
    Properties config = new Properties(System.getProperties());
    File db = new File(TARGET_RULES_DB);
    if (db.exists()) {
        FileUtils.deleteDirectory(db);//from ww w. j a va2 s. co  m
    }
    config.setProperty("javax.persistence.jdbc.url", CONNECTION_STRING);
    try {
        emf = Persistence.createEntityManagerFactory("hendrix", config);
    } catch (Exception e) {
        e.printStackTrace();
        throw e;
    }

    EntityManager em = emf.createEntityManager();

    Tenant tenant = new Tenant();
    tenant.setTenant_id(TENANT_ID_1);
    tenant.setTenant_name(TEST_TENANT);
    TenantManager.getInstance().createTenant(em, tenant);

    tenant = new Tenant();
    tenant.setTenant_id(TENANT_ID_2);
    tenant.setTenant_name(TEST_TENANT);
    TenantManager.getInstance().createTenant(em, tenant);

    tenant = new Tenant();
    tenant.setTenant_id(TENANT_ID_3);
    tenant.setTenant_name(TEST_TENANT);
    TenantManager.getInstance().createTenant(em, tenant);

    tenant = new Tenant();
    tenant.setTenant_id(TENANT_ID_5);
    tenant.setTenant_name(TEST_TENANT);
    TenantManager.getInstance().createTenant(em, tenant);

    em.close();
}

From source file:org.wavescale.hotload.agent.HotLoadAgent.java

/**
 * Parses agent options and fills up the config manager.
 *
 * @param args agent optional arguments//from   w  ww  . j  av  a2 s.  c  o m
 */
private static void initConfigManager(String[] args) {
    ConfigManager configManager = ConfigManager.getInstance();
    OptionsParser parser = new AgentArgParser(args);
    try {
        CommandLine options = parser.parse();
        // get the recursive monitoring option value
        if (options.hasOption("recursive")) {
            String recursive = options.getOptionValue("recursive");
            if (!"true".equals(recursive.toLowerCase())) {
                configManager.setMonitorRecursive(false);
            }
        }

        // get the number of virtual methods that can be instrumented
        if (options.hasOption("nr-of-virtual-methods")) {
            String nrOfVirtualMethods = options.getOptionValue("nr-of-virtual-methods");
            configManager.setNumberOfMethodsToBeAdded(Short.parseShort(nrOfVirtualMethods));
        }

        if (options.hasOption("class-path")) {
            String[] directoryToMonitor = options.getOptionValue("class-path").split(File.pathSeparator);
            configManager.setDirsToMonitor(directoryToMonitor);
        }

        if (options.hasOption("log-level")) {
            String logLevel = options.getOptionValue("log-level");
            switch (logLevel.toLowerCase()) {
            case "fine":
                configManager.setLogLevel(Level.FINE);
                break;
            case "info":
                configManager.setLogLevel(Level.INFO);
                break;
            case "warning":
                configManager.setLogLevel(Level.WARNING);
                break;
            case "severe":
                configManager.setLogLevel(Level.SEVERE);
                break;
            case "all":
                configManager.setLogLevel(Level.ALL);
                break;
            case "off":
                configManager.setLogLevel(Level.OFF);
                break;

            default:
                configManager.setLogLevel(Level.INFO);
            }
        }
    } catch (ParseException e) {
        LOGGER.log(Level.WARNING, "Could not parse agent arguments due to:" + e);
    }
}

From source file:org.geoserver.config.ServicePersisterTest.java

@Test
public void testRemoveWorkspaceLocalService() throws Exception {
    testAddWorkspaceLocalService();// w  w  w. j a  v  a2s.  c  o  m

    File dataDirRoot = getTestData().getDataDirectoryRoot();
    WorkspaceInfo ws = getCatalog().getDefaultWorkspace();

    File f = new File(dataDirRoot, "workspaces" + "/" + ws.getName() + "/service.xml");
    assertTrue(f.exists());

    Logger logger = Logging.getLogger(GeoServerImpl.class);
    Level level = logger.getLevel();
    try {
        logger.setLevel(Level.OFF);
        ServiceInfo s = geoServer.getServiceByName(ws, "foo", ServiceInfo.class);
        geoServer.remove(s);
        assertFalse(f.exists());
    } finally {
        logger.setLevel(level);
    }
}

From source file:com.srotya.tau.api.dao.TestRulesManager.java

@BeforeClass
public static void beforeClass() throws Exception {
    java.util.logging.Logger.getLogger("org.hibernate").setLevel(Level.OFF);
    Properties config = new Properties(System.getProperties());
    File db = new File(TARGET_RULES_DB);
    if (db.exists()) {
        FileUtils.deleteDirectory(db);// w  w w  .  j a  v  a2 s. c om
    }
    config.setProperty("javax.persistence.jdbc.url", CONNECTION_STRING);
    try {
        emf = Persistence.createEntityManagerFactory("tau", config);
    } catch (Exception e) {
        e.printStackTrace();
        throw e;
    }

    EntityManager em = emf.createEntityManager();

    RuleGroup ruleGroup = new RuleGroup();
    ruleGroup.setRuleGroupId(RULE_GROUP_ID_1);
    ruleGroup.setRuleGroupName(TEST_RULE_GROUP);
    RuleGroupManager.getInstance().createRuleGroup(em, ruleGroup);

    ruleGroup = new RuleGroup();
    ruleGroup.setRuleGroupId(RULE_GROUP_ID_2);
    ruleGroup.setRuleGroupName(TEST_RULE_GROUP);
    RuleGroupManager.getInstance().createRuleGroup(em, ruleGroup);

    ruleGroup = new RuleGroup();
    ruleGroup.setRuleGroupId(RULE_GROUP_ID_3);
    ruleGroup.setRuleGroupName(TEST_RULE_GROUP);
    RuleGroupManager.getInstance().createRuleGroup(em, ruleGroup);

    ruleGroup = new RuleGroup();
    ruleGroup.setRuleGroupId(RULE_GROUP_ID_5);
    ruleGroup.setRuleGroupName(TEST_RULE_GROUP);
    RuleGroupManager.getInstance().createRuleGroup(em, ruleGroup);

    em.close();
}

From source file:org.geoserver.wms.wms_1_3.GetFeatureInfoIntegrationTest.java

@Override
protected void onSetUp(SystemTestData testData) throws Exception {
    super.onSetUp(testData);

    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("xlink", "http://www.w3.org/1999/xlink");
    namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    namespaces.put("wms", "http://www.opengis.net/wms");
    namespaces.put("ows", "http://www.opengis.net/ows");
    namespaces.put("ogc", "http://www.opengis.net/ogc");
    namespaces.put("wfs", "http://www.opengis.net/wfs");
    namespaces.put("gml", "http://www.opengis.net/gml");
    namespaces.put(WCS_PREFIX, WCS_URI);

    NamespaceContext ctx = new SimpleNamespaceContext(namespaces);
    XMLUnit.setXpathNamespaceContext(ctx);

    Logging.getLogger("org.geoserver.ows").setLevel(Level.OFF);
    WMSInfo wmsInfo = getGeoServer().getService(WMSInfo.class);
    wmsInfo.setMaxBuffer(50);//from  ww  w .j  a v a 2s.  com
    getGeoServer().save(wmsInfo);

    Catalog catalog = getCatalog();

    testData.addStyle("thickStroke", "thickStroke.sld", CapabilitiesTest.class, catalog);
    testData.addStyle("raster", "raster.sld", CapabilitiesTest.class, catalog);
    testData.addStyle("rasterScales", "rasterScales.sld", CapabilitiesTest.class, catalog);
    testData.addStyle("squares", "squares.sld", CapabilitiesTest.class, catalog);
    testData.addStyle("forestsManyRules", "ForestsManyRules.sld", CapabilitiesTest.class, catalog);
    testData.addVectorLayer(SQUARES, Collections.EMPTY_MAP, "squares.properties", CapabilitiesTest.class,
            catalog);
    Map propertyMap = new HashMap();
    propertyMap.put(LayerProperty.STYLE, "raster");
    testData.addRasterLayer(TASMANIA_BM, "tazbm.tiff", "tiff", propertyMap, SystemTestData.class, catalog);
}

From source file:com.punyal.medusaserver.californiumServer.core.MedusaAuthenticationThread.java

@Override
public void run() {
    running = true;// w ww.j  ava 2 s. c om
    Logger.getLogger("org.eclipse.californium.core.network.CoAPEndpoint").setLevel(Level.OFF);
    Logger.getLogger("org.eclipse.californium.core.network.EndpointManager").setLevel(Level.OFF);
    Logger.getLogger("org.eclipse.californium.core.network.stack.ReliabilityLayer").setLevel(Level.OFF);

    CoapResponse response;

    while (running) {
        if (ticket.isValid()) {
            //System.out.println("Valid Ticket");
        } else {
            //System.out.println("Not Valid Ticket");

            try {
                coapClient.setURI(medusaServerAddress + "/" + MEDUSA_SERVER_AUTHENTICATION_SERVICE_NAME);
                response = coapClient.get();

                if (response != null) {
                    try {
                        JSONObject json = (JSONObject) JSONValue.parse(response.getResponseText());
                        ticket.setAuthenticator(json.get(JSON_AUTHENTICATOR).toString());
                        //System.out.println(ticket.getAuthenticator());

                        json.clear();
                        json.put(JSON_USER_NAME, medusaUserName);
                        json.put(JSON_USER_PASSWORD, Cryptonizer.encryptCoAP(medusaSecretKey,
                                ticket.getAuthenticator(), medusaUserPass));
                        json.put(JSON_INFO, medusaUserInfo);
                        //System.out.println(json.toString());

                        response = coapClient.put(json.toString(), 0);

                        if (response != null) {
                            json.clear();
                            try {
                                json = (JSONObject) JSONValue.parse(response.getResponseText());
                                ticket.setTicket(
                                        UnitConversion.hexStringToByteArray(json.get(JSON_TICKET).toString()));
                                ticket.setExpireTime(
                                        (Long) json.get(JSON_TIME_TO_EXPIRE) + (new Date()).getTime());
                                //System.out.println((Long)json.get(JSON_TIME_TO_EXPIRE));
                                noAuthenticationResponseCounter = 0;
                                noTicketResponseCounter = 0;
                                if (authenticated == false) {
                                    //LOGGER.log(Level.INFO, SMS_AUTHENTICATED);
                                    System.err.println(SMS_AUTHENTICATED);
                                    authenticated = true;
                                }
                            } catch (Exception e) {
                                noTicketResponseCounter++;
                                //System.out.println("JSON Error "+e);
                            }
                        } else {
                            //System.out.println("No Ticket received.");
                            noTicketResponseCounter++;
                        }
                    } catch (Exception e) {
                        noAuthenticationResponseCounter++;
                        //System.out.println("JSON Error "+e);
                    }

                } else {
                    //System.out.println("No Authentication received.");
                    noAuthenticationResponseCounter++;

                }
            } catch (IllegalArgumentException ex) {
                noAuthenticationResponseCounter++;
            }

            if ((authenticated == true)
                    && ((noAuthenticationResponseCounter != 0) || (noTicketResponseCounter != 0))) {
                //LOGGER.log(Level.INFO, SMS_NO_AUTHENTICATED);
                System.err.println(SMS_NO_AUTHENTICATED);
                authenticated = false;
            }

            if (noAuthenticationResponseCounter > MAX_NO_AUTHENTICATION_RESPONSES) {
                try {
                    //LOGGER.log(Level.WARNING, SMS_NO_AUTHENTICATION_RESPONSE);
                    System.err.println(SMS_NO_AUTHENTICATION_RESPONSE);
                    sleep(NO_AUTHENTICATION_RESPONSES_DELAY);
                } catch (InterruptedException ex) {
                    Logger.getLogger(MedusaAuthenticationThread.class.getName()).log(Level.SEVERE, null, ex);
                }
                noAuthenticationResponseCounter = 0;
                noTicketResponseCounter = 0;
            }
            if (noTicketResponseCounter > MAX_NO_TICKET_RESPONSES) {
                try {
                    //LOGGER.log(Level.WARNING, SMS_NO_TICKET_RESPONSE);
                    System.err.println(SMS_NO_TICKET_RESPONSE);
                    sleep(NO_TICKET_RESPONSES_DELAY);
                } catch (InterruptedException ex) {
                    Logger.getLogger(MedusaAuthenticationThread.class.getName()).log(Level.SEVERE, null, ex);
                }
                noAuthenticationResponseCounter = 0;
                noTicketResponseCounter = 0;
            }
        }

    }

    LOGGER.log(Level.WARNING, "Thread [{0}] dying", MedusaAuthenticationThread.class.getSimpleName());
}

From source file:com.gisgraphy.domain.geoloc.service.fulltextsearch.SolrClientTest.java

@Test
public void testSetSolRLogLevel() throws Exception {
    IsolrClient client = new SolrClient(AbstractIntegrationHttpSolrTestCase.fulltextSearchUrlBinded,
            new MultiThreadedHttpConnectionManager());
    assertTrue(client.isServerAlive());//  w w w.j a va 2 s.  c om
    client.setSolRLogLevel(Level.CONFIG);
    client.setSolRLogLevel(Level.FINE);
    client.setSolRLogLevel(Level.FINER);
    client.setSolRLogLevel(Level.FINEST);
    client.setSolRLogLevel(Level.INFO);
    client.setSolRLogLevel(Level.SEVERE);
    client.setSolRLogLevel(Level.WARNING);
    client.setSolRLogLevel(Level.ALL);
    client.setSolRLogLevel(Level.OFF);
}

From source file:com.github.luluvise.droid_utils.http.HttpConnectionManager.java

private HttpConnectionManager() {
    final Level logLevel = DroidConfig.DEBUG ? Level.CONFIG : Level.OFF;
    Logger.getLogger(HttpTransport.class.getName()).setLevel(logLevel);
}