{"id":33179578,"url":"https://github.com/t0xa/gelfj","last_synced_at":"2025-12-25T13:01:22.905Z","repository":{"id":1360793,"uuid":"1309527","full_name":"t0xa/gelfj","owner":"t0xa","description":"Graylog Extended Log Format (GELF) implementation in Java and log4j appender without any dependencies.","archived":false,"fork":false,"pushed_at":"2021-09-02T18:49:04.000Z","size":279,"stargazers_count":188,"open_issues_count":25,"forks_count":116,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-10-11T22:33:19.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/t0xa/gelfj/wiki","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t0xa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-01-30T17:56:58.000Z","updated_at":"2025-08-13T11:08:54.000Z","dependencies_parsed_at":"2022-07-29T10:39:46.550Z","dependency_job_id":null,"html_url":"https://github.com/t0xa/gelfj","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/t0xa/gelfj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xa%2Fgelfj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xa%2Fgelfj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xa%2Fgelfj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xa%2Fgelfj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t0xa","download_url":"https://codeload.github.com/t0xa/gelfj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xa%2Fgelfj/sbom","scorecard":{"id":864634,"data":{"date":"2025-08-11","repo":{"name":"github.com/t0xa/gelfj","commit":"a7de02354c8960d21ceafd9cc6651e2d481ed92a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":2,"reason":"Found 5/25 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-2qrg-x229-3v8q","Warn: Project is vulnerable to: GHSA-65fg-84f6-3jq3","Warn: Project is vulnerable to: GHSA-f7vh-qwp3-x37m","Warn: Project is vulnerable to: GHSA-fp5r-v3w9-4333","Warn: Project is vulnerable to: GHSA-w9p3-5cr8-m3jj"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T02:20:46.271Z","repository_id":1360793,"created_at":"2025-08-24T02:20:46.271Z","updated_at":"2025-08-24T02:20:46.271Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28030190,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-11-16T03:00:36.838Z","updated_at":"2025-12-25T13:01:22.900Z","avatar_url":"https://github.com/t0xa.png","language":"Java","funding_links":[],"categories":["日志库"],"sub_categories":[],"readme":"GELFJ - A GELF Appender for Log4j and a GELF Handler for JDK Logging\r\n====================================================================\r\n\r\nDownloading\r\n-----------\r\n\r\nAdd the following dependency section to your pom.xml:\r\n\r\n    \u003cdependencies\u003e\r\n      ...\r\n      \u003cdependency\u003e\r\n        \u003cgroupId\u003eorg.graylog2\u003c/groupId\u003e\r\n        \u003cartifactId\u003egelfj\u003c/artifactId\u003e\r\n        \u003cversion\u003e1.1.16\u003c/version\u003e\r\n        \u003cscope\u003ecompile\u003c/scope\u003e\r\n      \u003c/dependency\u003e\r\n      ...\r\n    \u003c/dependencies\u003e\r\n\r\nWhat is GELFJ\r\n-------------\r\n\r\nIt's very simple GELF implementation in pure Java with the Log4j appender and JDK Logging Handler. It supports chunked messages which allows you to send large log messages (stacktraces, environment variables, additional fields, etc.) to a [Graylog2](http://www.graylog2.org/) server.\r\n\r\nFollowing transports are supported:\r\n\r\n * TCP\r\n * UDP\r\n * AMQP\r\n\r\n\r\nHow to use GELFJ\r\n----------------\r\n\r\nDrop the latest JAR into your classpath and configure Log4j to use it.\r\n\r\nLog4j appender\r\n--------------\r\n\r\nGelfAppender will use the log message as a short message and a stacktrace (if exception available) as a long message if \"extractStacktrace\" is true.\r\n\r\nTo use GELF Facility as appender in Log4j (XML configuration format):\r\n\r\n    \u003cappender name=\"graylog2\" class=\"org.graylog2.log.GelfAppender\"\u003e\r\n        \u003cparam name=\"graylogHost\" value=\"192.168.0.201\"/\u003e\r\n        \u003cparam name=\"originHost\" value=\"my.machine.example.com\"/\u003e\r\n        \u003cparam name=\"extractStacktrace\" value=\"true\"/\u003e\r\n        \u003cparam name=\"addExtendedInformation\" value=\"true\"/\u003e\r\n        \u003cparam name=\"facility\" value=\"gelf-java\"/\u003e\r\n        \u003cparam name=\"Threshold\" value=\"INFO\"/\u003e\r\n        \u003cparam name=\"additionalFields\" value=\"{'environment': 'DEV', 'application': 'MyAPP'}\"/\u003e\r\n    \u003c/appender\u003e\r\n\r\nand then add it as a one of appenders:\r\n\r\n    \u003croot\u003e\r\n        \u003cpriority value=\"INFO\"/\u003e\r\n        \u003cappender-ref ref=\"graylog2\"/\u003e\r\n    \u003c/root\u003e\r\n\r\nOr, in the log4j.properties format:\r\n\r\n    # Define the graylog2 destination\r\n    log4j.appender.graylog2=org.graylog2.log.GelfAppender\r\n    log4j.appender.graylog2.graylogHost=graylog2.example.com\r\n    log4j.appender.graylog2.originHost=my.machine.example.com\r\n    log4j.appender.graylog2.facility=gelf-java\r\n    log4j.appender.graylog2.layout=org.apache.log4j.PatternLayout\r\n    log4j.appender.graylog2.extractStacktrace=true\r\n    log4j.appender.graylog2.addExtendedInformation=true\r\n    log4j.appender.graylog2.additionalFields={'environment': 'DEV', 'application': 'MyAPP'}\r\n\r\n    # Send all INFO logs to graylog2\r\n    log4j.rootLogger=INFO, graylog2\r\n\r\nAMQP Configuration:\r\n\r\n    log4j.appender.graylog2=org.graylog2.log.GelfAppender\r\n    log4j.appender.graylog2.amqpURI=amqp://amqp.address.com\r\n    log4j.appender.graylog2.amqpExchangeName=messages\r\n    log4j.appender.graylog2.amqpRoutingKey=gelfudp\r\n    log4j.appender.graylog2.amqpMaxRetries=5\r\n    log4j.appender.graylog2.facility=test-application\r\n    log4j.appender.graylog2.layout=org.apache.log4j.PatternLayout\r\n    log4j.appender.graylog2.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] [%c{1}] - %m%n\r\n    log4j.appender.graylog2.additionalFields={'environment': 'DEV', 'application': 'MyAPP'}\r\n    log4j.appender.graylog2.extractStacktrace=true\r\n    log4j.appender.graylog2.addExtendedInformation=true\r\n\r\nOptions\r\n-------\r\n\r\nGelfAppender supports the following options:\r\n\r\n- **graylogHost**: Graylog2 server where it will send the GELF messages; to use TCP instead of UDP, prefix with `tcp:`\r\n- **graylogPort**: Port on which the Graylog2 server is listening; default 12201 (*optional*)\r\n- **originHost**: Name of the originating host; defaults to the local hostname (*optional*)\r\n- **extractStacktrace** (true/false): Add stacktraces to the GELF message; default false (*optional*)\r\n- **addExtendedInformation** (true/false): Add extended information like Log4j's NDC/MDC; default false (*optional*)\r\n- **includeLocation** (true/false): Include caller file name and line number. Log4j documentation warns that generating caller location information is extremely slow and should be avoided unless execution speed is not an issue; default true (*optional*)\r\n- **facility**: Facility which to use in the GELF message; default \"gelf-java\"\r\n- **amqpURI**: AMQP URI (*required when using AMQP integration*)\r\n- **amqpExchangeName**: AMQP Exchange name - should be the same as setup in graylog2-radio (*required when using AMQP integration*)\r\n- **amqpRoutingKey**: AMQP Routing key - should be the same as setup in graylog2-radio (*required when using AMQP integration*)\r\n- **amqpMaxRetries**: Retries count; default value 0 (*optional*)\r\n\r\nAutomatically populating fields from a JSON message\r\n------------\r\n\r\n`GelfJsonAppender` is also available at `org.graylog2.log.GelfJsonAppender`. This appender is exactly the same as `GelfAppender` except that if you give it a parseable JSON string in the log4j message, then it will automatically set additional fields according to that JSON.\r\n\r\nFor example, given the log4j message `\"{\\\"simpleProperty\\\":\\\"hello gelf\\\"}\"`, the `GelfJsonAppender` will automatically add the additional field *simpleProperty* to your GELF logging. These fields are in addition to everything else. \r\n\r\nThe `GelfJsonAppender` is fail safe. If the given log4j message cannot be parsed as JSON, then the message will still be logged, but there will be no additional fields derived from the message.\r\n\r\nLogging Handler\r\n---------------\r\n\r\nConfigured via properties as a standard Handler like\r\n\r\n    handlers = org.graylog2.logging.GelfHandler\r\n\r\n    .level = ALL\r\n\r\n    org.graylog2.logging.GelfHandler.level = ALL\r\n    org.graylog2.logging.GelfHandler.graylogHost = syslog.example.com\r\n    #org.graylog2.logging.GelfHandler.graylogPort = 12201\r\n    #org.graylog2.logging.GelfHandler.extractStacktrace = true\r\n    #org.graylog2.logging.GelfHandler.additionalField.0 = foo=bah\r\n    #org.graylog2.logging.GelfHandler.additionalField.1 = foo2=bah2\r\n    #org.graylog2.logging.GelfHandler.facility = local0\r\n\r\n    .handlers=org.graylog2.logging.GelfHandler\r\n\r\nWhat is GELF\r\n------------\r\n\r\nThe Graylog Extended Log Format (GELF) avoids the shortcomings of classic plain syslog:\r\n\r\n- Limited to length of 1024 byte\r\n- Not much space for payloads like stacktraces\r\n- Unstructured. You can only build a long message string and define priority, severity etc.\r\n\r\nYou can get more information here: [http://www.graylog2.org/about/gelf](http://www.graylog2.org/about/gelf)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0xa%2Fgelfj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft0xa%2Fgelfj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0xa%2Fgelfj/lists"}