Example usage for java.util.logging Logger getLogger

List of usage examples for java.util.logging Logger getLogger

Introduction

In this page you can find the example usage for java.util.logging Logger getLogger.

Prototype




@CallerSensitive
public static Logger getLogger(String name) 

Source Link

Document

Find or create a logger for a named subsystem.

Usage

From source file:controller.PersonalGoalTextControllerTest.java

@AfterClass
public static void tearDownClass() {

    File file = new File(System.getProperty("user.dir") + fSeparator + "MyDiaryBook" + fSeparator);
    try {/*from w w w .  ja va 2 s  .c o  m*/
        FileUtils.deleteDirectory(file);
    } catch (IOException ex) {
        Logger.getLogger(NewEntryTextControllerTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.croer.javaorange.util.Configuration.java

public static CompositeConfiguration getCONFIGURATION() {
    if (CONFIGURATION == null) {
        List lc = new ArrayList();
        try {//w  w w .  j ava 2  s.  c o  m
            PropertiesConfiguration pc1 = new PropertiesConfiguration("prueba.properties");
            //                PropertiesConfiguration pc2 = new PropertiesConfiguration("mvc.properties");
            lc.add(pc1);
            //                lc.add(pc2);
        } catch (ConfigurationException ex) {
            Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
        }
        CONFIGURATION = new CompositeConfiguration(lc);
    }
    return CONFIGURATION;
}

From source file:it.cnr.ilc.tokenizer.utils.InputToString.java

/**
 * Convert an inputstream into a string/*  www.  j a  v  a 2 s. c o m*/
 * @param is the inputstream
 * @return the string from the input
 */
public static String convertInputStreamToString(InputStream is) {
    StringWriter writer = new StringWriter();
    String encoding = "UTF-8";
    String message = "";
    String theString = "";
    try {
        IOUtils.copy(is, writer, encoding);
        theString = writer.toString();
    } catch (Exception e) {
        message = "IOException in coverting the stream into a string " + e.getMessage();
        Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, message);
    }

    //System.err.println("DDDD " + theString);
    IOUtils.closeQuietly(is);
    IOUtils.closeQuietly(writer);
    return theString;
}

From source file:MyClass.java

public boolean myMethod(int p1, Object p2) {
    Logger logger = Logger.getLogger("com.mycompany.MyClass");
    if (logger.isLoggable(Level.FINER)) {
        logger.entering(this.getClass().getName(), "myMethod", new Object[] { new Integer(p1), p2 });
    }/*from w  w  w.  j  av a 2s  .  c o  m*/

    System.out.println("Method body");

    boolean result = true;
    if (logger.isLoggable(Level.FINER)) {
        logger.exiting(this.getClass().getName(), "myMethod", new Boolean(result));
        logger.exiting(this.getClass().getName(), "myMethod");
    }
    return result;
}

From source file:com.google.oacurl.util.LoggingConfig.java

public static void init(boolean verbose) throws SecurityException, IOException {
    System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Jdk14Logger");

    Logger defaultLogger = Logger.getLogger("");
    if (verbose) {
        defaultLogger.setLevel(Level.INFO);
    } else {/*from  w  w w  .  jav  a  2  s .c o m*/
        defaultLogger.setLevel(Level.SEVERE);
    }
}

From source file:com.pse.fotoz.helpers.Configuration.ConfigurationManager.java

public static void initConfig() {
    try {/*from  w  ww.  j a v  a 2 s . co  m*/
        config = new XMLConfiguration("application.cfg.xml");
        configPasswords = new XMLConfiguration("passwords.cfg.xml");
    } catch (ConfigurationException ex) {
        Logger.getLogger(ConfigurationManager.class.getName()).log(Level.SEVERE, null, ex);
    }
    FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
    strategy.setRefreshDelay(reloadDelayMS);
    config.setReloadingStrategy(strategy);
    config.setValidating(true); //valideer de xml
}

From source file:com.ontologycentral.ldspider.LDSpider_LogUtil.java

public static void setVerboseLogging() {
    Logger.getLogger("").setLevel(Level.INFO);
    Logger.getLogger("com.ontologycentral.ldspider").setLevel(Level.ALL);
    Logger.getLogger("").getHandlers()[0].setLevel(Level.ALL);
}

From source file:Main.java

/**
 * Turns on various logging interfaces for Apache HTTP Client including the use of SimpleLog
 *//* ww w .  jav a2 s.  c o m*/
public static void configuringLoggingApacheClient() {
    // According to http://stackoverflow.com/questions/3246792/how-to-enable-logging-for-apache-commons-httpclient-on-android
    // the following two lines are needed on Android. They aren't needed in general Java.
    Logger.getLogger("org.apache.http.wire").setLevel(Level.FINEST);
    Logger.getLogger("org.apache.http/headers").setLevel(Level.FINEST);

    System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");

    System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");

    System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header", "debug");

    System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");

    System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "all");
}

From source file:visualizer.datamining.dataanalysis.CreateLineGraph.java

public static void main(String[] args) {
    try {/*from  ww w  .  j  a  v  a2  s.com*/
        CreateLineGraph instance = CreateLineGraph.getInstance(null);
        instance.display("precision.txt");
        instance.dispose();
    } catch (IOException ex) {
        Logger.getLogger(CreateLineGraph.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:dao.NewEntryTextDaoTest.java

@AfterClass
public static void tearDownClass() {
    File file = new File(System.getProperty("user.dir") + fSeparator + "MyDiaryBook");
    try {/*from  w w  w. j  a  v  a 2  s . co m*/
        FileUtils.deleteDirectory(file);
    } catch (IOException ex) {
        Logger.getLogger(NewEntryTextDaoTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}