{"id":42156764,"url":"https://github.com/slb4j/slb4j","last_synced_at":"2026-01-30T01:52:38.273Z","repository":{"id":332963253,"uuid":"1133890963","full_name":"slb4j/slb4j","owner":"slb4j","description":"Simple Logging Backend for Java","archived":false,"fork":false,"pushed_at":"2026-01-27T05:21:13.000Z","size":1219,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-27T05:46:06.903Z","etag":null,"topics":["java","jcl","log","log4j","logging","slf4j"],"latest_commit_sha":null,"homepage":null,"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/slb4j.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-14T00:44:45.000Z","updated_at":"2026-01-27T05:21:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/slb4j/slb4j","commit_stats":null,"previous_names":["slb4j/slb4j"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/slb4j/slb4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slb4j%2Fslb4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slb4j%2Fslb4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slb4j%2Fslb4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slb4j%2Fslb4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slb4j","download_url":"https://codeload.github.com/slb4j/slb4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slb4j%2Fslb4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28894805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["java","jcl","log","log4j","logging","slf4j"],"created_at":"2026-01-26T19:29:08.636Z","updated_at":"2026-01-30T01:52:38.266Z","avatar_url":"https://github.com/slb4j.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Note: This document is still inomplete**\n\n# SLB4J\n\nSLB4J is a **Simple Logging Backend for Java** that comes as a single JAR without any dependencies.\n\n- Log4J pattern syntax\n- Logging to console or log files\n- log rotation\n- filtering\n- configuration using a properties file or in code\n\nThere is also an extension package that provides UI elements for live monitoring an application's log messages.\n\nJava 21+ is required.\n\n## Supported Logging APIs\n\nSLB4J supports the following logging APIs:\n\n- JUL (Java Util Logging)\n- Log4J2\n- SLF4J\n- JCL (Jakarta Commons Logging / Apache Commons Logging)\n\n## How to Use\n\n### Add the SLB4J Dependency\n\n**Maven**\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.slb4j\u003c/groupId\u003e\n  \u003cartifactId\u003eslb4j\u003c/artifactId\u003e\n  \u003cversion\u003e0.1-rc\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**Gradle (Kotlin DSL)**\n\n```kotlin\ndependencies {\n    implementation(\"org.slb4j:slb4j:0.1-rc\")\n}\n```\n\n**Gradle (Groovy DSL)**\n\n```groovy\ndependencies {\n    implementation 'org.slb4j:slb4j:0.1-rc'\n}\n```\n\n### If the main application uses JUL Logging: nitialize the Library\n\n**Note:** This is only necessary if the main application is using JUL logging since JUL does not lookup the backend\nimplementation using SPI (Service Provider Infrastructure). If your main application uses one of the other \nlogging frontends, JUL will be automatically initialized when SLB4J is loaded.\n\nAdd this static initializer to the class containing your `main` method:\n\n```java\nstatic {\n    SLB4J.init();\n}\n```\n\n### Remove Other Logging Backends and Bridges\n\nSLB4J provides a unified logging interface, so you can remove other logging backends and bridge implementations from your project.\n\n**Keep only the frontends you use**:\n\n| Frontend / API          | Artifact Name   | Description                                                                                                                     |\n|-------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------|\n| SLF4J                   | slf4j-api       | Simple Logging Facade for Java; provides a uniform API that can route to various logging backends.                              |\n| Log4J 2 API             | log4j-api       | Apache Log4J 2's native logging API with async logging, filters, and markers.                                                  |\n| java.util.logging (JUL) | (part of JDK)   | Built-in Java logging API since Java 1.4. Often bridged to SLF4J for consistent logging.                                        |\n| Commons Logging (JCL)   | commons-logging | Lightweight logging facade, mostly used in older libraries; usually bridged to SLF4J today.                                     |\n\n**Remove backends, bridges, and bindings** if you have them in your project:\n\n| Title                   | Artifact Name    | Description                            |\n|-------------------------|------------------|----------------------------------------|\n| Log4J2 backend          | log4j-core       | Log4J2 logging backend                 |\n| SLF4J → Log4J2 binding  | log4j-slf4j-impl | SLF4J binding to Log4J2 backend        |\n| SLF4J → Logback backend | logback-classic  | Logging backend using SLF4J (Logback)  |\n| SLF4J → console backend | slf4j-simple     | Simple SLF4J backend (console output)  |\n| SLF4J → JUL binding     | slf4j-jdk14      | SLF4J binding to java.util.logging     |\n| JUL → SLF4J bridge      | jul-to-slf4j     | Routes java.util.logging to SLF4J      |\n| Log4J1 → SLF4J bridge   | log4j-over-slf4j | Routes Log4J 1.x to SLF4J (deprecated) |\n| Log4J2 → SLF4J bridge   | log4j-to-slf4j   | Routes Log4J2 API to SLF4J             |\n| JCL → SLF4J bridge      | jcl-over-slf4j   | Routes Commons Logging (JCL) to SLF4J  |\n\n## Benchmarks\n\nThe repository contains a `run_benchmarks.py` script for benchmarking different logging\nbackends and frontends. The script provides a comprehensive comparison of performance\nacross the logging systems, including JUL, Log4J2, SLF4J, JCL, and their respective\nbindings and bridges.\n\nRun `run_benchmarks.py --help` to display the options that can be passed to the script.\n\nNote: the  smoketest mode does not produce usable numbers; it is intended for testing\nthe benchmark script and that the different backends and frontends are configured\ncorrectly.\n\n## Status\n\n### Done\n\n- **Backend**\n  - Console handler\n  - File handler\n  - Logfile rotation\n- **Frontend support**\n  - JUL (Java Util Logging)\n  - Log4J2\n  - SLF4J\n  - JCL (Jakarta Commons Logging / Apache Commons Logging)\n- **Log4J2 compatible message pattern**\n  - Standard patterns\n  - MDC support\n  - Marker support\n  - Location support\n- `logging.properties` file\n- Filters\n- UI components for live monitoring\n- Benchmarks\n- Setup CI\n- Publish to Maven Central\n\n### Todo\n\n- Publish Javadoc\n- Add benchmark results\n\n### Later\n\n- JSON output format\n- Read back JSON logs for later analysis\n\n### Not Planned\n\n#### Async logging\n\nThe file handlers already use **pre-allocated buffers** to reduce lock contention in multi-threaded \nenvironments. Even async loggers will hit a throughput limit determined by the I/O system and must either block or\ndrop messages.\n\nYou can configure SLB4J to flush only messages with level INFO or higher. Messages below that level are buffered\nand written once the buffer is full or a high-priority message triggers a flush.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslb4j%2Fslb4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslb4j%2Fslb4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslb4j%2Fslb4j/lists"}