本文整理了Java中com.proofpoint.log.Logger
类的一些代码示例,展示了Logger
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger
类的具体详情如下:
包路径:com.proofpoint.log.Logger
类名称:Logger
暂无
代码示例来源:origin: com.proofpoint.platform/log
/**
* Logs a message at ERROR level.
* <p>
* Usage example:
* <pre>
* logger.error("something really bad happened when connecting to %s:%d", host, port);
* </pre>
* If the format string is invalid or the arguments are insufficient, an error will be logged and execution
* will continue.
*
* @param format a format string compatible with String.format()
* @param args arguments for the format string
*/
public void error(String format, Object... args)
{
error(null, format, args);
}
代码示例来源:origin: com.proofpoint.platform/log
public synchronized void disableConsole()
{
log.info("Disabling stderr output");
ROOT.removeHandler(consoleHandler);
consoleHandler = null;
}
代码示例来源:origin: com.proofpoint.platform/log
/**
* Logs a message at WARN level.
* <p>
* Usage example:
* <pre>
* logger.warn("something bad happened when connecting to %s:%d", host, port);
* </pre>
* If the format string is invalid or the arguments are insufficient, an error will be logged and execution
* will continue.
*
* @param format a format string compatible with String.format()
* @param args arguments for the format string
*/
public void warn(String format, Object... args)
{
warn(null, format, args);
}
代码示例来源:origin: com.proofpoint.galaxy/galaxy-cli
public void warn(WARNING_ID id, String message, Object... data)
{
String msg;
try {
msg = String.format(message, data);
}
catch (IllegalFormatException e) {
msg = message + " " + Arrays.toString(data);
}
Logger.get("jnr-posix").warn(msg);
}
代码示例来源:origin: com.proofpoint.platform/bootstrap
private void stopList(Queue<Object> instances, Class<? extends Annotation> annotation)
{
List<Object> reversedInstances = Lists.newArrayList(instances);
Collections.reverse(reversedInstances);
for (Object obj : reversedInstances) {
log.debug("Stopping %s", obj.getClass().getName());
LifeCycleMethods methods = methodsMap.get(obj.getClass());
for (Method preDestroy : methods.methodsFor(annotation)) {
log.debug("\t%s()", preDestroy.getName());
try {
preDestroy.invoke(obj);
}
catch (Exception e) {
log.error(e, "Stopping %s.%s() failed:", obj.getClass().getName(), preDestroy.getName());
}
}
}
}
代码示例来源:origin: com.proofpoint.platform/cassandra-experimental
@Override
public void stopRPCServer()
{
synchronized (this) {
if (isRunning) {
log.info("Cassandra shutting down...");
server.stopServer();
try {
server.join();
}
catch (InterruptedException e) {
log.error(e, "Interrupted while waiting for thrift server to stop");
Thread.currentThread().interrupt();
}
isRunning = false;
}
}
}
代码示例来源:origin: com.proofpoint.galaxy/galaxy-coordinator
@Override
public void setServiceInventory(List<ServiceDescriptor> serviceInventory)
{
if (agentStatus.getState() == ONLINE) {
Preconditions.checkNotNull(serviceInventory, "serviceInventory is null");
URI internalUri = agentStatus.getInternalUri();
try {
Request request = RequestBuilder.preparePut()
.setUri(uriBuilderFrom(internalUri).appendPath("/v1/serviceInventory").build())
.setHeader(CONTENT_TYPE, APPLICATION_JSON)
.setBodyGenerator(jsonBodyGenerator(serviceDescriptorsCodec, new ServiceDescriptorsRepresentation(environment, serviceInventory)))
.build();
httpClient.execute(request, createStatusResponseHandler());
if (serviceInventoryUp.compareAndSet(false, true)) {
log.info("Service inventory put succeeded for agent at %s", internalUri);
}
}
catch (Exception e) {
if (serviceInventoryUp.compareAndSet(true, false) && !log.isDebugEnabled()) {
log.error("Unable to post service inventory to agent at %s: %s", internalUri, e.getMessage());
}
log.debug(e, "Unable to post service inventory to agent at %s: %s", internalUri, e.getMessage());
}
}
}
代码示例来源:origin: com.proofpoint.platform/cassandra-experimental
private void setup()
throws IOException, ConfigurationException
log.info("Heap size: %s/%s", Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory());
CLibrary.tryMlockall();
log.debug("opening keyspace " + table);
Table.open(table);
log.warn("Unable to start GCInspector (currently only supported on the Sun JVM)");
代码示例来源:origin: com.proofpoint.platform/rack
Logger.get(Main.class).error(e);
System.err.flush();
System.out.flush();
代码示例来源:origin: com.proofpoint.platform/bootstrap
private void startInstance(Object obj, Collection<Method> methods)
throws IllegalAccessException, InvocationTargetException
{
log.debug("Starting %s", obj.getClass().getName());
for (Method method : methods) {
log.debug("\t%s()", method.getName());
method.invoke(obj);
}
}
}
代码示例来源:origin: com.proofpoint.platform/http-server
adminExternalUri = buildUri("http", nodeInfo.getExternalAddress(), adminUri.getPort());
Logger.get("Bootstrap").info("Admin service on %s", adminUri);
代码示例来源:origin: com.proofpoint.platform/log
/**
* Gets a logger named after a class' fully qualified name.
*
* @param clazz the class
* @return the named logger
*/
public static Logger get(Class<?> clazz)
{
return get(clazz.getName());
}
代码示例来源:origin: com.proofpoint.platform/bootstrap
throw new Exception("System already starting");
log.info("Life cycle starting...");
log.error(e, "Trying to shut down");
log.info("Life cycle startup complete. System ready.");
代码示例来源:origin: com.proofpoint.platform/rack-experimental
public static void main(String[] args)
throws Exception
{
Bootstrap app = new Bootstrap(
new NodeModule(),
new HttpServerModule(),
new HttpEventModule(),
new DiscoveryModule(),
new JsonModule(),
new MBeanModule(),
new RackModule(),
new JmxModule(),
new JmxHttpRpcModule());
try {
Injector injector = app.initialize();
injector.getInstance(Announcer.class).start();
}
catch (Exception e) {
Logger.get(Main.class).error(e);
System.err.flush();
System.out.flush();
System.exit(0);
}
catch (Throwable t) {
System.exit(0);
}
}
}
代码示例来源:origin: com.proofpoint.platform/event
@Override
public Void handleException(Request request, Exception exception)
throws Exception
{
log.debug(exception, "Posting event to %s failed", request.getUri());
throw exception;
}
代码示例来源:origin: com.proofpoint.platform/log
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
private static void redirectStdStreams()
{
try {
System.setOut(new PrintStream(new LoggingOutputStream(Logger.get("stdout")), true, "UTF-8"));
System.setErr(new PrintStream(new LoggingOutputStream(Logger.get("stderr")), true, "UTF-8"));
}
catch (UnsupportedEncodingException ignored) {
}
}
代码示例来源:origin: com.proofpoint.galaxy/galaxy-coordinator
private void expectedStateStoreDown(Exception e)
{
if (storeUp.compareAndSet(true, false)) {
log.error(e, "Expected state store is down");
}
}
代码示例来源:origin: com.proofpoint.galaxy/galaxy-coordinator
private void expectedStateStoreUp()
{
if (storeUp.compareAndSet(false, true)) {
log.info("Expected state store is up");
}
}
代码示例来源:origin: com.proofpoint.platform/bootstrap
@Override
public void onWarning(String message)
{
if (loggingInitialized.get()) {
log.warn(message);
}
else {
warnings.add(message);
}
}
代码示例来源:origin: com.proofpoint.platform/http-client-experimental
@Override
public AsyncHttpClient get()
{
HttpClientConfig config = injector.getInstance(Key.get(HttpClientConfig.class, annotation));
NettyAsyncHttpClientConfig asyncConfig = injector.getInstance(Key.get(NettyAsyncHttpClientConfig.class, annotation));
Set<HttpRequestFilter> filters = injector.getInstance(filterKey(annotation));
NettyIoPool ioPool;
if (injector.getExistingBinding(Key.get(NettyIoPool.class, annotation)) != null) {
ioPool = injector.getInstance(Key.get(NettyIoPool.class, annotation));
log.debug("HttpClient %s uses private IO thread pool", name);
}
else {
log.debug("HttpClient %s uses shared IO thread pool", name);
ioPool = injector.getInstance(NettyIoPool.class);
}
NettyAsyncHttpClient client = new NettyAsyncHttpClient(name, ioPool, config, asyncConfig, filters);
clients.add(client);
return client;
}
}
内容来源于网络,如有侵权,请联系作者删除!