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:com.me.DAO.DAO1.java

public Connection getConnection() {
    Connection conn = null;/*ww w  .  ja  v  a  2  s .  c  o  m*/
    try {
        conn = DriverManager.getConnection(dburl, dbuser, dbpassword);

    } catch (SQLException ex) {
        Logger.getLogger(DAO1.class.getName()).log(Level.SEVERE, null, ex);
    }
    return conn;
}

From source file:ec.edu.espe.distribuidas.web.ReportFacturaBean.java

public void generateReport() {
    //generar reporte
    super.pdf("factura", "factura");
    try {/*  w ww  .  j  a  va  2s  .  c o  m*/
        this.testMultiPartEmail();
    } catch (UnsupportedEncodingException | EmailException | MalformedURLException ex) {
        Logger.getLogger(ReportFacturaBean.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:caillou.company.clonemanager.gui.spring.SpringFxmlLoader.java

public static LoadingMojo load(String url, final String controllerClassName) {

    lastLoadedURL = url;/*www.  j  ava 2  s  .c  o  m*/
    FXMLLoader loader = new FXMLLoader(MainApp.class.getResource(url), resourceBundle);
    loader.setControllerFactory(new Callback<Class<?>, Object>() {
        @Override
        public Object call(Class<?> clazz) {
            if (controllerClassName != null) {
                try {
                    return applicationContext.getBean(Class.forName(controllerClassName));
                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(SpringFxmlLoader.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
            return applicationContext.getBean(clazz);
        }
    });

    try {
        Parent parent = loader.load();
        LoadingMojo loadingMojo = new LoadingMojo();
        loadingMojo.setController(loader.getController());
        loadingMojo.setParent(parent);
        return loadingMojo;
    } catch (IOException ex) {
        Logger.getLogger(SpringFxmlLoader.class.getName()).log(Level.SEVERE, null, ex);
    } catch (Exception exMain) {
        System.out.println("Error");
    }
    return null;
}

From source file:com.cooksys.httpserver.ParsedHttpRequest.java

public static ParsedHttpRequest parseHttpRequest(HttpRequest request, String messageBody) {
    ParsedHttpRequest parsedRequest = new ParsedHttpRequest();

    parsedRequest.requestLine = request.getRequestLine().toString();
    parsedRequest.method = request.getRequestLine().getMethod();

    try {// ww w  .ja va 2 s . co  m
        //Parse the URI
        URI uri = new URI(request.getRequestLine().getUri());
        parsedRequest.uriPath = uri.getPath();
        parsedRequest.uriParams = parseUrlParameters(uri);
        parsedRequest.headers = (parseHeaders(request));
        parsedRequest.messageBody = messageBody;
    } catch (URISyntaxException | ParseException ex) {
        Logger.getLogger(ParsedHttpRequest.class.getName()).log(Level.SEVERE, null, ex);
    }
    return parsedRequest;
}

From source file:com.app.inventario.dao.FamiliaDAOImpl.java

@Override
public void guardar(Familia familia) {
    try {/*ww  w  .j  a  v  a  2s .co m*/
        this.iniciaOperacion();
        session.save(familia);
        tx.commit();
    } catch (HibernateException he) {
        Logger.getLogger(FamiliaDAOImpl.class.getName()).log(Level.SEVERE, null, he);
        throw he;
    } finally {
        // Cerrar la session
    }
}

From source file:cz.certicon.routing.web.model.beans.DatabasePropertiesBean.java

public Properties getConnectionProperties() {
    if (connectionProperties == null) {
        InputStream in = getClass().getClassLoader().getResourceAsStream("database_connection.properties");
        connectionProperties = new Properties();
        try {// w  ww .  ja v  a  2s .  c om
            connectionProperties.load(in);
            in.close();
        } catch (IOException ex) {
            connectionProperties = null;
            Logger.getLogger(GraphBean.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    return connectionProperties;
}

From source file:me.cavar.pg2tei.Gutenberg2TEI.java

/**
 *
 * @param outputFolder/*from w ww.  ja v  a2s.c o m*/
 * @param catalogOutFN
 */
public static void processRDF(String outputFolder, String catalogOutFN, String ebookURLStr) {
    System.out.println("Processing catalog.rdf");
    File rdfFile = new File(outputFolder, catalogOutFN);
    RDFParser myRdfP = new RDFParser(ebookURLStr, outputFolder);
    try {
        System.out.println(rdfFile.getAbsolutePath());
        myRdfP.parseDocument(rdfFile.getAbsolutePath());
    } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
        Logger.getLogger(Fetcher.class.getName()).log(Level.SEVERE, null, e);
    }
    System.out.printf("Number of entries: %d\n", myRdfP.getEntryCounter());
}

From source file:com.qait.automation.samjbehavedemo.utils.FileHandler.java

public static void cleanStoryLocation() {
    File storiesDir = getFile(Constants.STORY_LOC);
    if (storiesDir.exists()) {
        try {/*from w ww .jav a  2  s  .  c o m*/
            FileUtils.deleteDirectory(storiesDir);

        } catch (IOException ex) {
            Logger.getLogger(JiraStoryDownloader.class.getName()).log(Level.SEVERE,
                    "UNABLE TO DELETE OLD STORIES", ex);
            ex.printStackTrace();
        }
    }
    storiesDir.mkdir();
}

From source file:com.imag.nespros.network.devices.SacomutDevice.java

public SacomutDevice(String name) {
    super(name);//from   w  ww  . j  av a 2 s .co m
    this.setCpuSpeed(350);
    this.setTotalMemory(1024);
    this.setDeviceType(DeviceType.SACOMUT);
    this.setDeviceName(name);
    try {
        byte[] imageInByte;
        imageInByte = IOUtils.toByteArray(getClass().getClassLoader().getResourceAsStream("image/sacomut.jpg"));
        icon = new MyLayeredIcon(new ImageIcon(imageInByte).getImage());
    } catch (IOException ex) {
        Logger.getLogger(AMIDevice.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.iontorrent.main.TSSettings.java

private static void err(Exception ex) {
    Logger.getLogger(TSSettings.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
}