Create a gist now

Instantly share code, notes, and snippets.

Embed
Fluentd Javaプラグインのサンプル
// $ export CLASSPATH=.:./fluent-logger-0.2.5-SNAPSHOT-jar-with-dependencies.jar
// $ javac FluentLogClient.java
// $ java FluentLogClient
import java.util.HashMap;
import java.util.Map;
import org.fluentd.logger.FluentLogger;
public class FluentLogClient {
private static FluentLogger LOG = FluentLogger.getLogger("myapp");
public static void main(String[] args) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("keyFromJava1", "valueFromJava1");
data.put("keyFromJava2", "valueFromJava2");
LOG.log("debug", data);
System.out.println("Logging.");
FluentLogger.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment