All Projects → fluent → Fluent Logger Java

fluent / Fluent Logger Java

Licence: apache-2.0
A structured logger for Fluentd (Java)

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Fluent Logger Java

Fluent Plugin Zabbix
fluentd out plugin to zabbix
Stars: ✭ 46 (-75.27%)
Mutual labels:  fluentd
Fluentd
Fluentd: Unified Logging Layer (project under CNCF)
Stars: ✭ 10,807 (+5710.22%)
Mutual labels:  fluentd
Fluent Plugin Rewrite Tag Filter
Fluentd Output filter plugin to rewrite tags that matches specified attribute.
Stars: ✭ 151 (-18.82%)
Mutual labels:  fluentd
Log Pilot
Collect logs for docker containers
Stars: ✭ 1,112 (+497.85%)
Mutual labels:  fluentd
Logback More Appenders
Extra appenders for Logback.
Stars: ✭ 93 (-50%)
Mutual labels:  fluentd
Aws Eks Kubernetes Masterclass
AWS EKS Kubernetes - Masterclass | DevOps, Microservices
Stars: ✭ 129 (-30.65%)
Mutual labels:  fluentd
Fluent Bit Go Loki
[Deprecated] The predessor of fluent-bit output plugin for Loki. https://github.com/grafana/loki
Stars: ✭ 38 (-79.57%)
Mutual labels:  fluentd
Gofluent
(Not Maintained) Something acting like fluentd rewritten in Go.
Stars: ✭ 174 (-6.45%)
Mutual labels:  fluentd
Fluent Agent Hydra
A Fluentd log agent.
Stars: ✭ 102 (-45.16%)
Mutual labels:  fluentd
Dagger
Dagger 是一个基于 Loki 的日志查询和管理系统,它是由达闼科技( CloudMinds )云团队的`大禹基础设施平台`派生出来的一个项目。Dagger 运行在 Loki 前端,具备日志查询、搜索,保存和下载等特性,适用于云原生场景下的容器日志管理场景。
Stars: ✭ 149 (-19.89%)
Mutual labels:  fluentd
Fluent Plugin Concat
Fluentd Filter plugin to concatenate multiline log separated in multiple events.
Stars: ✭ 78 (-58.06%)
Mutual labels:  fluentd
Go Fluentd
rewrite fluentd in golang
Stars: ✭ 89 (-52.15%)
Mutual labels:  fluentd
Terraform Aws Elasticsearch
Terraform module to provision an Elasticsearch cluster with built-in integrations with Kibana and Logstash.
Stars: ✭ 137 (-26.34%)
Mutual labels:  fluentd
Fluent Plugin Splunk Hec
This is the Fluentd output plugin for sending events to Splunk via HEC.
Stars: ✭ 56 (-69.89%)
Mutual labels:  fluentd
Fluentular
Fluentular is a Fluentd regular expression editor
Stars: ✭ 154 (-17.2%)
Mutual labels:  fluentd
Fluent Logger Perl
A structured logger for Fluentd (Perl)
Stars: ✭ 41 (-77.96%)
Mutual labels:  fluentd
Fluent Plugin Systemd
This is a fluentd input plugin. It reads logs from the systemd journal.
Stars: ✭ 124 (-33.33%)
Mutual labels:  fluentd
Fluent Plugin Cloudwatch Logs
CloudWatch Logs Plugin for Fluentd
Stars: ✭ 179 (-3.76%)
Mutual labels:  fluentd
Fluent Plugin Mongo
MongoDB input and output plugin for Fluentd
Stars: ✭ 163 (-12.37%)
Mutual labels:  fluentd
Pathivu
An efficient log ingestion and log aggregation system https://pathivu.io/
Stars: ✭ 146 (-21.51%)
Mutual labels:  fluentd

Fluent Logger for Java

Build Status

Overview

Many web/mobile applications generate huge amount of event logs (c,f. login, logout, purchase, follow, etc). Analyzing these event logs can be quite valuable for improving services. However, collecting these logs easily and reliably is a challenging task.

Fluentd solves the problem by having: easy installation, small footprint, plugins, reliable buffering, log forwarding, etc.

fluent-logger-java is a Java library, to record events via Fluentd, from Java application.

Requirements

Java >= 1.6

Install

Install with all-in-one jar file

You can download all-in-one jar file for Fluent Logger for Java.

wget http://central.maven.org/maven2/org/fluentd/fluent-logger/${logger.version}/fluent-logger-${logger.version}-jar-with-dependencies.jar   

To use Fluent Logger for Java, set the above jar file to your classpath.

Install from Maven2 repository

Fluent Logger for Java is released on Fluent Maven2 repository. You can configure your pom.xml or build.gradle as follows to use it:

Maven:

<dependencies>
  ...
  <dependency>
    <groupId>org.fluentd</groupId>
    <artifactId>fluent-logger</artifactId>
    <version>${logger.version}</version>
  </dependency>
  ...
</dependencies>

Gradle:

dependencies {
    compile 'org.fluentd:fluent-logger:'+loggerVersion
}

Install from Github repository

You can get latest source code using git.

git clone [email protected]:fluent/fluent-logger-java.git
cd fluent-logger-java
mvn assembly:assembly

You will get the fluent logger jar file in fluent-logger-java/target directory. File name will be fluent-logger-${logger.version}-jar-with-dependencies.jar. For more detail, see pom.xml.

Replace ${logger.version} or loggerVersion with the current version of Fluent Logger for Java.

Quickstart

The following program is a small example of Fluent Logger for Java.

import java.util.HashMap;
import java.util.Map;
import org.fluentd.logger.FluentLogger;

public class Main {
    private static FluentLogger LOG = FluentLogger.getLogger("app");

    public void doApplicationLogic() {
        // ...
        Map<String, Object> data = new HashMap<String, Object>();
        data.put("from", "userA");
        data.put("to", "userB");
        LOG.log("follow", data);
        // ...
    }
}

To create Fluent Logger instances, users need to invoke getLogger method in FluentLogger class like org.slf4j, org.log4j logging libraries. The method should be called only once. By default, the logger assumes fluent daemon is launched locally. You can also specify remote logger by passing the following options.

// for remote fluentd
private static FluentLogger LOG = FluentLogger.getLogger("app", "remotehost", port);

Then, please create the events like this. This will send the event to fluentd, with tag 'app.follow' and the attributes 'from' and 'to'.

Close method in FluentLogger class should be called explicitly when application is finished. The method closes socket connection with the fluentd.

FluentLogger.close();

License

Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].