Java
Last updated
Was this helpful?
Was this helpful?
# for rpm/deb only
$ sudo /etc/init.d/td-agent restart
# or systemd
$ sudo systemctl restart td-agent.service<dependencies>
...
<dependency>
<groupId>org.fluentd</groupId>
<artifactId>fluent-logger</artifactId>
<version>${logger.version}</version>
</dependency>
...
</dependencies>import java.util.HashMap;
import java.util.Map;
import org.fluentd.logger.FluentLogger;
public class Main {
private static FluentLogger LOG = FluentLogger.getLogger("fluentd.test");
public void doApplicationLogic() {
// ...
Map<String, Object> data = new HashMap<String, Object>();
data.put("from", "userA");
data.put("to", "userB");
LOG.log("follow", data);
// ...
}
}$ java -jar test.jar