com.proofpoint.log.Logger类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(230)

本文整理了Java中com.proofpoint.log.Logger类的一些代码示例,展示了Logger类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger类的具体详情如下:
包路径:com.proofpoint.log.Logger
类名称:Logger

Logger介绍

暂无

代码示例

代码示例来源:origin: com.proofpoint.platform/log

  1. /**
  2. * Logs a message at ERROR level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.error("something really bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void error(String format, Object... args)
  15. {
  16. error(null, format, args);
  17. }

代码示例来源:origin: com.proofpoint.platform/log

  1. public synchronized void disableConsole()
  2. {
  3. log.info("Disabling stderr output");
  4. ROOT.removeHandler(consoleHandler);
  5. consoleHandler = null;
  6. }

代码示例来源:origin: com.proofpoint.platform/log

  1. /**
  2. * Logs a message at WARN level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.warn("something bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void warn(String format, Object... args)
  15. {
  16. warn(null, format, args);
  17. }

代码示例来源:origin: com.proofpoint.galaxy/galaxy-cli

  1. public void warn(WARNING_ID id, String message, Object... data)
  2. {
  3. String msg;
  4. try {
  5. msg = String.format(message, data);
  6. }
  7. catch (IllegalFormatException e) {
  8. msg = message + " " + Arrays.toString(data);
  9. }
  10. Logger.get("jnr-posix").warn(msg);
  11. }

代码示例来源:origin: com.proofpoint.platform/bootstrap

  1. private void stopList(Queue<Object> instances, Class<? extends Annotation> annotation)
  2. {
  3. List<Object> reversedInstances = Lists.newArrayList(instances);
  4. Collections.reverse(reversedInstances);
  5. for (Object obj : reversedInstances) {
  6. log.debug("Stopping %s", obj.getClass().getName());
  7. LifeCycleMethods methods = methodsMap.get(obj.getClass());
  8. for (Method preDestroy : methods.methodsFor(annotation)) {
  9. log.debug("\t%s()", preDestroy.getName());
  10. try {
  11. preDestroy.invoke(obj);
  12. }
  13. catch (Exception e) {
  14. log.error(e, "Stopping %s.%s() failed:", obj.getClass().getName(), preDestroy.getName());
  15. }
  16. }
  17. }
  18. }

代码示例来源:origin: com.proofpoint.platform/cassandra-experimental

  1. @Override
  2. public void stopRPCServer()
  3. {
  4. synchronized (this) {
  5. if (isRunning) {
  6. log.info("Cassandra shutting down...");
  7. server.stopServer();
  8. try {
  9. server.join();
  10. }
  11. catch (InterruptedException e) {
  12. log.error(e, "Interrupted while waiting for thrift server to stop");
  13. Thread.currentThread().interrupt();
  14. }
  15. isRunning = false;
  16. }
  17. }
  18. }

代码示例来源:origin: com.proofpoint.galaxy/galaxy-coordinator

  1. @Override
  2. public void setServiceInventory(List<ServiceDescriptor> serviceInventory)
  3. {
  4. if (agentStatus.getState() == ONLINE) {
  5. Preconditions.checkNotNull(serviceInventory, "serviceInventory is null");
  6. URI internalUri = agentStatus.getInternalUri();
  7. try {
  8. Request request = RequestBuilder.preparePut()
  9. .setUri(uriBuilderFrom(internalUri).appendPath("/v1/serviceInventory").build())
  10. .setHeader(CONTENT_TYPE, APPLICATION_JSON)
  11. .setBodyGenerator(jsonBodyGenerator(serviceDescriptorsCodec, new ServiceDescriptorsRepresentation(environment, serviceInventory)))
  12. .build();
  13. httpClient.execute(request, createStatusResponseHandler());
  14. if (serviceInventoryUp.compareAndSet(false, true)) {
  15. log.info("Service inventory put succeeded for agent at %s", internalUri);
  16. }
  17. }
  18. catch (Exception e) {
  19. if (serviceInventoryUp.compareAndSet(true, false) && !log.isDebugEnabled()) {
  20. log.error("Unable to post service inventory to agent at %s: %s", internalUri, e.getMessage());
  21. }
  22. log.debug(e, "Unable to post service inventory to agent at %s: %s", internalUri, e.getMessage());
  23. }
  24. }
  25. }

代码示例来源:origin: com.proofpoint.platform/cassandra-experimental

  1. private void setup()
  2. throws IOException, ConfigurationException
  3. log.info("Heap size: %s/%s", Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory());
  4. CLibrary.tryMlockall();
  5. log.debug("opening keyspace " + table);
  6. Table.open(table);
  7. log.warn("Unable to start GCInspector (currently only supported on the Sun JVM)");

代码示例来源:origin: com.proofpoint.platform/rack

  1. Logger.get(Main.class).error(e);
  2. System.err.flush();
  3. System.out.flush();

代码示例来源:origin: com.proofpoint.platform/bootstrap

  1. private void startInstance(Object obj, Collection<Method> methods)
  2. throws IllegalAccessException, InvocationTargetException
  3. {
  4. log.debug("Starting %s", obj.getClass().getName());
  5. for (Method method : methods) {
  6. log.debug("\t%s()", method.getName());
  7. method.invoke(obj);
  8. }
  9. }
  10. }

代码示例来源:origin: com.proofpoint.platform/http-server

  1. adminExternalUri = buildUri("http", nodeInfo.getExternalAddress(), adminUri.getPort());
  2. Logger.get("Bootstrap").info("Admin service on %s", adminUri);

代码示例来源:origin: com.proofpoint.platform/log

  1. /**
  2. * Gets a logger named after a class' fully qualified name.
  3. *
  4. * @param clazz the class
  5. * @return the named logger
  6. */
  7. public static Logger get(Class<?> clazz)
  8. {
  9. return get(clazz.getName());
  10. }

代码示例来源:origin: com.proofpoint.platform/bootstrap

  1. throw new Exception("System already starting");
  2. log.info("Life cycle starting...");
  3. log.error(e, "Trying to shut down");
  4. log.info("Life cycle startup complete. System ready.");

代码示例来源:origin: com.proofpoint.platform/rack-experimental

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Bootstrap app = new Bootstrap(
  5. new NodeModule(),
  6. new HttpServerModule(),
  7. new HttpEventModule(),
  8. new DiscoveryModule(),
  9. new JsonModule(),
  10. new MBeanModule(),
  11. new RackModule(),
  12. new JmxModule(),
  13. new JmxHttpRpcModule());
  14. try {
  15. Injector injector = app.initialize();
  16. injector.getInstance(Announcer.class).start();
  17. }
  18. catch (Exception e) {
  19. Logger.get(Main.class).error(e);
  20. System.err.flush();
  21. System.out.flush();
  22. System.exit(0);
  23. }
  24. catch (Throwable t) {
  25. System.exit(0);
  26. }
  27. }
  28. }

代码示例来源:origin: com.proofpoint.platform/event

  1. @Override
  2. public Void handleException(Request request, Exception exception)
  3. throws Exception
  4. {
  5. log.debug(exception, "Posting event to %s failed", request.getUri());
  6. throw exception;
  7. }

代码示例来源:origin: com.proofpoint.platform/log

  1. @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
  2. private static void redirectStdStreams()
  3. {
  4. try {
  5. System.setOut(new PrintStream(new LoggingOutputStream(Logger.get("stdout")), true, "UTF-8"));
  6. System.setErr(new PrintStream(new LoggingOutputStream(Logger.get("stderr")), true, "UTF-8"));
  7. }
  8. catch (UnsupportedEncodingException ignored) {
  9. }
  10. }

代码示例来源:origin: com.proofpoint.galaxy/galaxy-coordinator

  1. private void expectedStateStoreDown(Exception e)
  2. {
  3. if (storeUp.compareAndSet(true, false)) {
  4. log.error(e, "Expected state store is down");
  5. }
  6. }

代码示例来源:origin: com.proofpoint.galaxy/galaxy-coordinator

  1. private void expectedStateStoreUp()
  2. {
  3. if (storeUp.compareAndSet(false, true)) {
  4. log.info("Expected state store is up");
  5. }
  6. }

代码示例来源:origin: com.proofpoint.platform/bootstrap

  1. @Override
  2. public void onWarning(String message)
  3. {
  4. if (loggingInitialized.get()) {
  5. log.warn(message);
  6. }
  7. else {
  8. warnings.add(message);
  9. }
  10. }

代码示例来源:origin: com.proofpoint.platform/http-client-experimental

  1. @Override
  2. public AsyncHttpClient get()
  3. {
  4. HttpClientConfig config = injector.getInstance(Key.get(HttpClientConfig.class, annotation));
  5. NettyAsyncHttpClientConfig asyncConfig = injector.getInstance(Key.get(NettyAsyncHttpClientConfig.class, annotation));
  6. Set<HttpRequestFilter> filters = injector.getInstance(filterKey(annotation));
  7. NettyIoPool ioPool;
  8. if (injector.getExistingBinding(Key.get(NettyIoPool.class, annotation)) != null) {
  9. ioPool = injector.getInstance(Key.get(NettyIoPool.class, annotation));
  10. log.debug("HttpClient %s uses private IO thread pool", name);
  11. }
  12. else {
  13. log.debug("HttpClient %s uses shared IO thread pool", name);
  14. ioPool = injector.getInstance(NettyIoPool.class);
  15. }
  16. NettyAsyncHttpClient client = new NettyAsyncHttpClient(name, ioPool, config, asyncConfig, filters);
  17. clients.add(client);
  18. return client;
  19. }
  20. }

相关文章