{"id":15344686,"url":"https://github.com/mbien/jfrlog","last_synced_at":"2025-09-19T20:20:02.305Z","repository":{"id":136542971,"uuid":"289457874","full_name":"mbien/JFRLog","owner":"mbien","description":"JFRLog - a SLF4J to JFR Bridge","archived":false,"fork":false,"pushed_at":"2023-09-25T03:23:32.000Z","size":46,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T20:21:36.119Z","etag":null,"topics":["flight-recorder","java","jfr","jfr-bridge","jvm","logging","openjdk","slf4j"],"latest_commit_sha":null,"homepage":"https://mbien.dev/blog/entry/jfrlog-logging-directly-to-the","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbien.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-08-22T09:22:44.000Z","updated_at":"2025-03-25T22:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfcb3cf0-5e0f-4582-beef-b74bb87f35bf","html_url":"https://github.com/mbien/JFRLog","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"5023951b0c744c972b763fefda4cdcefa2c76493"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mbien/JFRLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbien%2FJFRLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbien%2FJFRLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbien%2FJFRLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbien%2FJFRLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbien","download_url":"https://codeload.github.com/mbien/JFRLog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbien%2FJFRLog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275997319,"owners_count":25567377,"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-09-19T02:00:09.700Z","response_time":108,"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":["flight-recorder","java","jfr","jfr-bridge","jvm","logging","openjdk","slf4j"],"created_at":"2024-10-01T11:02:04.750Z","updated_at":"2025-09-19T20:20:02.283Z","avatar_url":"https://github.com/mbien.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JFRLog - a SLF4J to JFR Bridge\nThis project implements a SLF4J logger which records all log messages as Java Flight Recorder events.\n\n\n## quickstart\n1. replace your SLF4J compatible logging impl with slf4j-jfr-bridge-x.x.x.jar\n2. start the JVM with JFR enabled (e.g. -XX:StartFlightRecording:filename=logs/recording.jfr,dumponexit=true)\n   or enable recording later\n3. check the flight recorder repository or recording dump for log.* events:\n\n```bash\n$ jfr print --events \"log.*\" logs/recording.jfr\n...\nlog.Info {\n  startTime = 07:38:02.730\n  message = \"Started @5532ms\"\n  origin = \"org.eclipse.jetty.server.Server\"\n  throwable = N/A\n  eventThread = \"main\" (javaThreadId = 1)\n}\n...\n```\nnote: JFRLog has currently no fallback, if no recording is active you won't see any logs.\n\n## maven central coordinates\n```xml\n\u003c!-- depends on slf4j-api already, but feel free to add it anyway --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.mbien.jfrlog\u003c/groupId\u003e\n    \u003cartifactId\u003eslf4j-jfr-bridge\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## configuration\nJFRLog can be configured in two ways: via JVM -D arguments or via a jfrlog.properties\nfile in the classpath. JVM -D properties are handled with higher priority and override\nproperties with the same key stored in the file.\n(note: disabling specific log events in the JFR recording profile will filter the loggers too)\n\nexample:\n```\njava -Djfrlog.default=info -Djfrlog.dev.cool.app=error -Djfrlog.dev.cool.app.MyKlass=debug (...) app.jar\n```\nSets MyKlass to debug, the rest of the package to error and the default log level\nto info for everything else. The most specific rule wins (order does not matter).\n\n\nother options:\n```\njfrlog.recordOrigin=true\n```\nRecords the origin (logger name) of the log message. Enabled by default.\n\n```\njfrlog.loggerCache=false\n```\nThis is off by default and should be kept off unless there is a good reason to enable\nit. It is going to guarantee that the same logger instance is returned for a given\nlogger name.\n\n\n## commandline tools\nJFRLog also provides commandline tools for easy JFR record inspection.\n\nAdd the jbang catalog:\n```bash\n$ jbang catalog add jfrlog https://github.com/mbien/JFRLog/blob/master/cli/jbang-catalog.json\n```\n\nand use jfrprint to print JFR events (not only log message events).\n```bash\n$ MSG_PATTERN=\"{eventName,0d,C} {startTime,dt:yyyy-MM-dd HH:mm:ss.SSS} [{eventThread.javaName}]\\\n {origin,1d}: {message} {throwable,o,n}\"\n$ jbang jfrprint 10h log.* \"$MSG_PATTERN\" dump.jfr\nINFO 2020-09-30 16:12:42.458 [main] jfrlogtest.LogTest: Hello There!\nWARN 2020-09-30 16:12:42.461 [main] jfrlogtest.LogTest: don’t panic\njava.lang.IllegalArgumentException: test, please ignore\n\tat dev.mbien.jfrlogtest.LogTest.main(LogTest.java:12)\n...\n```\nMore info in this [blog entry](https://mbien.dev/blog/entry/jfrlog-commandline-tools)\n\n## requirements\nJFRLog requires Java 8+ to run, but Java 14+ to build/test since the junit tests rely on the JFR\nstreaming API (JEP 349).\n\n## license\nThis project is distributed under the MIT License, see LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbien%2Fjfrlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbien%2Fjfrlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbien%2Fjfrlog/lists"}