use of java.util.logging.Logger in project camel by apache.
the class BonitaAPIUtil method getInstance.
public static BonitaAPIUtil getInstance(BonitaAPIConfig bonitaAPIConfig) {
if (instance == null) {
instance = new BonitaAPIUtil();
ClientConfig clientConfig = new ClientConfig();
clientConfig.register(MultiPartFeature.class);
clientConfig.register(JacksonJsonProvider.class);
Logger logger = Logger.getLogger("org.bonitasoft.camel.bonita.api.util.BonitaAPIUtil");
Feature feature = new LoggingFeature(logger, Level.INFO, null, null);
clientConfig.register(feature);
ClientBuilder clientBuilder = ClientBuilder.newBuilder().withConfig(clientConfig);
Client client = clientBuilder.build();
client.register(new JsonClientFilter());
client.register(new BonitaAuthFilter(bonitaAPIConfig));
instance.setWebTarget(client.target(bonitaAPIConfig.getBaseBonitaURI()));
}
return instance;
}
use of java.util.logging.Logger in project groovy by apache.
the class NodePrinterTest method testLogging.
public void testLogging() {
Logger log = Logger.getLogger(getClass().getName());
log.info("Logging using JDK 1.4 logging");
}
use of java.util.logging.Logger in project tomcat by apache.
the class Tomcat method setSilent.
/**
* Controls if the loggers will be silenced or not.
* @param silent <code>true</code> sets the log level to WARN for the
* loggers that log information on Tomcat start up. This
* prevents the usual startup information being logged.
* <code>false</code> sets the log level to the default
* level of INFO.
*/
public void setSilent(boolean silent) {
this.silent = silent;
for (String s : silences) {
Logger logger = Logger.getLogger(s);
pinnedLoggers.put(s, logger);
if (silent) {
logger.setLevel(Level.WARNING);
} else {
logger.setLevel(Level.INFO);
}
}
}
use of java.util.logging.Logger in project GCViewer by chewiebug.
the class DataReaderFacade method loadModel.
/**
* Loads a model from a given <code>gcResource</code> logging all exceptions that occur.
*
* @param gcResource where to find data to be parsed
* @return instance of GCModel containing all information that was parsed
* @throws DataReaderException if any exception occurred, it is logged and added as the cause
* to this exception
*/
public GCModel loadModel(GCResource gcResource) throws DataReaderException {
if (gcResource == null) {
throw new NullPointerException("gcResource must never be null");
}
if (gcResource instanceof GcResourceSeries) {
return loadModelFromSeries((GcResourceSeries) gcResource);
}
if (!(gcResource instanceof GcResourceFile))
throw new UnsupportedOperationException("Only supported for files!");
DataReaderException dataReaderException = new DataReaderException();
GCModel model = null;
Logger logger = gcResource.getLogger();
try {
logger.info("GCViewer version " + BuildInfoReader.getVersion() + " (" + BuildInfoReader.getBuildDate() + ")");
model = readModel((GcResourceFile) gcResource);
} catch (RuntimeException | IOException e) {
dataReaderException.initCause(e);
logger.warning(LocalisationHelper.getString("fileopen_dialog_read_file_failed") + "\n" + e.toString() + " " + e.getLocalizedMessage());
}
if (dataReaderException.getCause() != null) {
throw dataReaderException;
}
return model;
}
use of java.util.logging.Logger in project deeplearning4j by deeplearning4j.
the class Util method disableLogging.
public static Level disableLogging() {
Logger logger = Logger.getLogger("org.apache.uima");
while (logger.getLevel() == null) {
logger = logger.getParent();
}
Level level = logger.getLevel();
logger.setLevel(Level.OFF);
return level;
}
Aggregations