gelfclient

A GELF client library based on Netty 4.

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем Graylog Библиотеки уровня приложения Logging
Группа

Группа

org.graylog2
Идентификатор

Идентификатор

gelfclient
Последняя версия

Последняя версия

1.5.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

gelfclient
A GELF client library based on Netty 4.
Ссылка на сайт

Ссылка на сайт

https://github.com/Graylog2/gelfclient
Организация-разработчик

Организация-разработчик

Graylog, Inc.
Система контроля версий

Система контроля версий

https://github.com/Graylog2/gelfclient

Скачать gelfclient

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.graylog2/gelfclient/ -->
<dependency>
    <groupId>org.graylog2</groupId>
    <artifactId>gelfclient</artifactId>
    <version>1.5.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.graylog2/gelfclient/
implementation 'org.graylog2:gelfclient:1.5.1'
// https://jarcasting.com/artifacts/org.graylog2/gelfclient/
implementation ("org.graylog2:gelfclient:1.5.1")
'org.graylog2:gelfclient:jar:1.5.1'
<dependency org="org.graylog2" name="gelfclient" rev="1.5.1">
  <artifact name="gelfclient" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.graylog2', module='gelfclient', version='1.5.1')
)
libraryDependencies += "org.graylog2" % "gelfclient" % "1.5.1"
[org.graylog2/gelfclient "1.5.1"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
io.netty : netty-handler jar 4.1.59.Final
com.fasterxml.jackson.core : jackson-core jar 2.8.11
org.slf4j : slf4j-api jar 1.7.25

test (3)

Идентификатор библиотеки Тип Версия
org.testng : testng jar 6.14.3
org.mockito : mockito-core jar 2.19.0
org.slf4j : slf4j-simple jar 1.7.25

Модули Проекта

Данный проект не имеет модулей.

GELF Client

Maven Central Build Status Coverage Status

A Java GELF client library with support for different transports.

Available transports:

  • TCP
  • UDP

All default transport implementations use a queue to send messages in a background thread to avoid blocking the calling thread until a message has been sent. That means that the send() and trySend() methods do not actually send the messages but add them to a queue where the background thread will pick them up. This is important to keep in mind when it comes to message delivery guarantees.

The library uses Netty v4 to handle all network related tasks and Jackson for JSON encoding.

Usage

Maven Dependency

<dependency>
  <groupId>org.graylog2</groupId>
  <artifactId>gelfclient</artifactId>
  <version>1.5.1</version>
</dependency>

Example

public class Application {
    public static void main(String[] args) {
        final GelfConfiguration config = new GelfConfiguration(new InetSocketAddress("example.com", 12201))
              .transport(GelfTransports.UDP)
              .queueSize(512)
              .connectTimeout(5000)
              .reconnectDelay(1000)
              .tcpNoDelay(true)
              .sendBufferSize(32768);

        final GelfTransport transport = GelfTransports.create(config);
        final GelfMessageBuilder builder = new GelfMessageBuilder("", "example.com")
                .level(GelfMessageLevel.INFO)
                .additionalField("_foo", "bar");

        boolean blocking = false;
        for (int i = 0; i < 100; i++) {
            final GelfMessage message = builder.message("This is message #" + i)
                    .additionalField("_count", i)
                    .build();

            if (blocking) {
                // Blocks until there is capacity in the queue
                transport.send(message);
            } else {
                // Returns false if there isn't enough room in the queue
                boolean enqueued = transport.trySend(message);
            }
        }
    }
}

Contributing

Please see CONTRIBUTING for details.

License

Apache License, Version 2.0 -- http://www.apache.org/licenses/LICENSE-2.0

org.graylog2

Graylog

Версии библиотеки

Версия
1.5.1
1.5.0
1.4.4
1.4.3
1.4.2.1
1.4.2
1.4.1
1.4.0
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0