{"id":19788343,"url":"https://github.com/graylog2/gelfclient","last_synced_at":"2025-04-06T00:09:18.223Z","repository":{"id":54090499,"uuid":"20569644","full_name":"Graylog2/gelfclient","owner":"Graylog2","description":"GELF client library for Java based on Netty 4","archived":false,"fork":false,"pushed_at":"2024-03-12T16:45:54.000Z","size":533,"stargazers_count":39,"open_issues_count":18,"forks_count":20,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-29T22:11:17.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.graylog.org/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Graylog2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-06T16:01:43.000Z","updated_at":"2025-02-25T11:18:31.000Z","dependencies_parsed_at":"2024-03-12T17:51:02.328Z","dependency_job_id":"8e00f861-d7af-41c7-ace1-19e88270262d","html_url":"https://github.com/Graylog2/gelfclient","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graylog2%2Fgelfclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graylog2%2Fgelfclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graylog2%2Fgelfclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graylog2%2Fgelfclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Graylog2","download_url":"https://codeload.github.com/Graylog2/gelfclient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T06:26:56.401Z","updated_at":"2025-04-06T00:09:18.205Z","avatar_url":"https://github.com/Graylog2.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"GELF Client\n===========\n\n[![Maven Central](https://img.shields.io/maven-central/v/org.graylog2/gelfclient.svg)](https://mvnrepository.com/artifact/org.graylog2/gelfclient)\n[![Build](https://github.com/Graylog2/gelfclient/actions/workflows/build.yml/badge.svg)](https://github.com/Graylog2/gelfclient/actions/workflows/build.yml)\n\nA Java GELF client library with support for different transports.\n\nAvailable transports:\n\n* TCP\n* UDP\n\nAll default transport implementations use a queue to send messages in a\nbackground thread to avoid blocking the calling thread until a message has\nbeen sent. That means that the `send()` and `trySend()` methods do not\nactually send the messages but add them to a queue where the background\nthread will pick them up. This is important to keep in mind when it comes to\nmessage delivery guarantees.\n\nThe library uses [Netty v4](http://netty.io/) to handle all network related\ntasks and [Jackson](https://github.com/FasterXML/jackson) for JSON encoding.\n\n## Usage\n\n### Maven Dependency\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.graylog2\u003c/groupId\u003e\n  \u003cartifactId\u003egelfclient\u003c/artifactId\u003e\n  \u003cversion\u003e1.5.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Example\n\n```java\npublic class Application {\n    public static void main(String[] args) {\n        final GelfConfiguration config = new GelfConfiguration(new InetSocketAddress(\"example.com\", 12201))\n              .transport(GelfTransports.UDP)\n              .queueSize(512)\n              .connectTimeout(5000)\n              .reconnectDelay(1000)\n              .tcpNoDelay(true)\n              .sendBufferSize(32768);\n\n        final GelfTransport transport = GelfTransports.create(config);\n        final GelfMessageBuilder builder = new GelfMessageBuilder(\"\", \"example.com\")\n                .level(GelfMessageLevel.INFO)\n                .additionalField(\"_foo\", \"bar\");\n\n        boolean blocking = false;\n        for (int i = 0; i \u003c 100; i++) {\n            final GelfMessage message = builder.message(\"This is message #\" + i)\n                    .additionalField(\"_count\", i)\n                    .build();\n\n            if (blocking) {\n                // Blocks until there is capacity in the queue\n                transport.send(message);\n            } else {\n                // Returns false if there isn't enough room in the queue\n                boolean enqueued = transport.trySend(message);\n            }\n        }\n    }\n}\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## License\n\nApache License, Version 2.0 -- http://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraylog2%2Fgelfclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraylog2%2Fgelfclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraylog2%2Fgelfclient/lists"}