List of usage examples for java.util.logging Level FINE
Level FINE
To view the source code for java.util.logging Level FINE.
Click Source Link
From source file:net.kungfoo.grizzly.proxy.impl.ProxyAdapter.java
private static void logURIAndMethod(String uri, MessageBytes method) { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, format("Incomming request. URI: {0}, Method: {1}", uri, method)); }/*from w w w.j a v a 2 s . c o m*/ }
From source file:de.jfachwert.post.Adresse.java
private static boolean hasPLZ(String line) { try {/*from w w w. j a v a 2 s. c o m*/ Ort ort = new Ort(line); return ort.getPLZ().isPresent(); } catch (ValidationException ex) { LOG.log(Level.FINE, "no PLZ inside '" + line + "' found:", ex); return false; } }
From source file:com.rubenlaguna.en4j.mainmodule.NoteListTopComponent.java
public void refresh() { LOG.log(Level.FINE, "refresh notelist {0}. just performSearch again", new SimpleDateFormat("h:mm:ss a").format(new Date())); performSearch(false);/* www. j a v a2 s . com*/ }
From source file:dk.hippogrif.prettyxml.app.Main.java
static CommandLine parse(String[] args) { CommandLineParser parser = new BasicParser(); CommandLine cmd = null;/* w w w . j av a 2 s .co m*/ try { cmd = parser.parse(options, args); } catch (ParseException pe) { logger.log(Level.FINE, "parse", pe); } return cmd; }
From source file:com.esri.gpt.control.webharvest.client.waf.FtpClientRequest.java
public String readTextFile(String pathName) throws IOException { try {//from w ww . jav a 2 s . c o m LOG.log(Level.FINE, "Reading text file on: {0} from the path: {1}", new Object[] { host, pathName }); return readTextFile(1, pathName); } catch (IOException ex) { aborted = true; throw ex; } }
From source file:com.stratuscom.harvester.codebase.ClassServer.java
private void establishServerSocket() throws IOException, SocketException { server = new ServerSocket(); server.setReuseAddress(true);//ww w . j a v a 2s.co m String initialPortStr = properties.getProperty(Strings.INITIAL_PORT); if (initialPortStr == null) { throw new LocalizedRuntimeException(MessageNames.BUNDLE_NAME, MessageNames.MISSING_PROPERTY_ENTRY, new Object[] { Strings.CLASS_SERVER_PROPERTIES, Strings.INITIAL_PORT }); } int initialPort = Integer.parseInt(initialPortStr); for (int port = initialPort; port < initialPort + 100; port++) try { server.bind(new InetSocketAddress(port)); logger.log(Level.INFO, MessageNames.CLASS_SERVER_ESTABLISHED, new Object[] { server.getLocalSocketAddress(), server.getLocalPort() }); break; } catch (BindException be) { logger.log(Level.FINE, MessageNames.PORT_IN_USE, new Integer[] { port }); } }
From source file:org.archive.modules.fetcher.FetchDNS.java
protected void innerProcess(CrawlURI curi) { Record[] rrecordSet = null; // Retrieved dns records String dnsName = null;/*w ww . ja v a 2s. c o m*/ try { dnsName = curi.getUURI().getReferencedHost(); } catch (URIException e) { logger.log(Level.SEVERE, "Failed parse of dns record " + curi, e); } if (dnsName == null) { curi.setFetchStatus(S_UNFETCHABLE_URI); return; } CrawlHost targetHost = getServerCache().getHostFor(dnsName); if (isQuadAddress(curi, dnsName, targetHost)) { // We're done processing. return; } // Do actual DNS lookup. curi.setFetchBeginTime(System.currentTimeMillis()); // Try to get the records for this host (assume domain name) // TODO: Bug #935119 concerns potential hang here String lookupName = dnsName.endsWith(".") ? dnsName : dnsName + "."; try { rrecordSet = (new Lookup(lookupName, TypeType, ClassType)).run(); } catch (TextParseException e) { rrecordSet = null; } curi.setContentType("text/dns"); if (rrecordSet != null) { if (logger.isLoggable(Level.FINE)) { logger.fine("Found recordset for " + lookupName); } storeDNSRecord(curi, dnsName, targetHost, rrecordSet); } else { if (logger.isLoggable(Level.FINE)) { logger.fine("Failed find of recordset for " + lookupName); } if (getAcceptNonDnsResolves() || "localhost".equals(dnsName)) { // Do lookup that bypasses javadns. InetAddress address = null; try { address = InetAddress.getByName(dnsName); } catch (UnknownHostException e1) { address = null; } if (address != null) { targetHost.setIP(address, DEFAULT_TTL_FOR_NON_DNS_RESOLVES); curi.setFetchStatus(S_GETBYNAME_SUCCESS); if (logger.isLoggable(Level.FINE)) { logger.fine("Found address for " + dnsName + " using native dns."); } } else { if (logger.isLoggable(Level.FINE)) { logger.fine("Failed find of address for " + dnsName + " using native dns."); } setUnresolvable(curi, targetHost); } } else { setUnresolvable(curi, targetHost); } } curi.setFetchCompletedTime(System.currentTimeMillis()); }
From source file:edu.wpi.cs.wpisuitetng.modules.core.entitymanagers.UserManager.java
@Override public void save(Session s, User model) throws WPISuiteException { if (data.save(model)) { logger.log(Level.FINE, "User Saved :" + model); return;// w w w . j ava2 s . c o m } else { logger.log(Level.WARNING, "User Save Failure!"); throw new DatabaseException("Save failure for User."); // Session User: " + s.getUsername() + " User: " + model.getName()); } }
From source file:com.izforge.izpack.util.LogUtils.java
public static void loadConfiguration(final Properties configuration) throws IOException { if (OVERRIDE) { LogManager manager = LogManager.getLogManager(); // Merge global logging properties InputStream baseResourceStream = null; try {//from www . j av a 2 s. com baseResourceStream = LogUtils.class.getResourceAsStream(LOGGING_BASE_CONFIGURATION); final Properties baseProps = new Properties(); baseProps.load(baseResourceStream); mergeLoggingConfiguration(configuration, baseProps); } finally { IOUtils.closeQuietly(baseResourceStream); } boolean mkdirs = false; String pattern = null; if (configuration.getProperty("handlers") != null && configuration.getProperty("handlers").contains(FILEHANDLER_CLASSNAME) && manager.getProperty("handlers").contains(FILEHANDLER_CLASSNAME)) { // IzPack maintains just one log file, don't override the existing handler type of it. // Special use case: Command line argument -logfile "wins" over the <log-file> tag. // Assumption at the moment for optimization: Just FileHandler is used for configurations from install.xml. return; } for (String key : configuration.stringPropertyNames()) { if (key.equals(FILEHANDLER_CLASSNAME + ".pattern")) { // Workaround for not normalized file paths, for example ${INSTALL_PATH}/../install_log/name.log // to get them working before creating ${INSTALL_PATH} in the // com.izforge.izpack.installer.unpacker.UnpackerBase.preUnpack phase // otherwise the FileHandler will fail when opening files already in constructor and not recover from that. pattern = FilenameUtils.normalize(configuration.getProperty(key)); configuration.setProperty(key, pattern); } else if (key.equals(FILEHANDLER_CLASSNAME + ".mkdirs")) { // This key goes beyond the capabilities of java.util.logging.FileHandler mkdirs = Boolean.parseBoolean(configuration.getProperty(key)); configuration.remove(key); } } if (mkdirs && pattern != null) { FileUtils.forceMkdirParent(new File(pattern)); } // Merge user settings compiled in final Properties userProps = new Properties(); InputStream userPropsStream = LogUtils.class .getResourceAsStream(ResourceManager.getInstallLoggingConfigurationResourceName()); try { if (userPropsStream != null) { userProps.load(userPropsStream); for (String userPropName : userProps.stringPropertyNames()) { if (userPropName.endsWith(".level") && !userPropName.startsWith(FILEHANDLER_CLASSNAME)) { String level = userProps.getProperty(userPropName); if (level != null) { configuration.setProperty(userPropName, level); } } } } } finally { IOUtils.closeQuietly(userPropsStream); } InputStream defaultResourceStream = null; try { defaultResourceStream = LogUtils.class.getResourceAsStream(LOGGING_CONFIGURATION); final Properties defaultProps = new Properties(); defaultProps.load(defaultResourceStream); mergeLoggingConfiguration(configuration, defaultProps); } finally { IOUtils.closeQuietly(defaultResourceStream); } if (Debug.isDEBUG()) { configuration.setProperty(FILEHANDLER_CLASSNAME + ".level", Level.FINE.toString()); configuration.setProperty(ConsoleHandler.class.getName() + ".level", Level.FINE.toString()); } // Set general log level which acts as filter in front of all handlers String fileLevelName = configuration.getProperty(FILEHANDLER_CLASSNAME + ".level", Level.ALL.toString()); Level fileLevel = Level.ALL; if (fileLevelName != null) { fileLevel = Level.parse(fileLevelName); } String consoleLevelName = configuration.getProperty(CONSOLEHANDLER_CLASSNAME + ".level", Level.INFO.toString()); Level consoleLevel = Level.INFO; if (consoleLevelName != null) { consoleLevel = Level.parse(consoleLevelName); } configuration.setProperty(".level", (fileLevel.intValue() < consoleLevel.intValue()) ? fileLevelName : consoleLevelName); final PipedOutputStream out = new PipedOutputStream(); final PipedInputStream in = new PipedInputStream(out); try { new Thread(new Runnable() { public void run() { try { configuration.store(out, null); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(out); } } }).start(); manager.readConfiguration(in); } finally { IOUtils.closeQuietly(in); } } }
From source file:com.ibm.ws.lars.rest.RepositoryRESTResourceLoggingTest.java
@Test public void testCreateAttachmentWithContent(@Mocked final Logger logger, @Mocked final BufferedInMultiPart inMultiPart) throws InvalidJsonAssetException, InvalidIdException, AssetPersistenceException, NonExistentArtefactException { new Expectations() { {//from w ww.j a v a 2 s . c om logger.isLoggable(Level.FINE); result = true; logger.fine("createAttachmentWithContent called, name: " + "name" + " assetId: " + NON_EXISTENT_ID); } }; getRestResource().createAttachmentWithContent("name", NON_EXISTENT_ID, null, inMultiPart, dummyUriInfo); }