APISonar


org.fluentd.logger.FluentLogger.log

> org > fluentd > logger > FluentLogger > log
org APIs fluentd APIs logger APIs FluentLogger APIs log APIs

Example 1
private static FluentLogger ERRORS = FluentLogger.getLogger("myapp");

  public static void report(Throwable ex) {
    StringWriter exceptionWriter = new StringWriter();
    ex.printStackTrace(new PrintWriter(exceptionWriter));
    Map<String, Object> data = new HashMap<>();
    data.put("message", exceptionWriter.toString());
    Map<String,String> serviceContextData = new HashMap<>();
    serviceContextData.put("service", "myapp");
    data.put("serviceContext", serviceContextData);
    // ... add more metadata
    ERRORS.log("errors", data);
  }