{"id":48786699,"url":"https://github.com/zaben903/journalrb","last_synced_at":"2026-04-18T22:00:58.673Z","repository":{"id":350826119,"uuid":"1208415888","full_name":"zaben903/journalrb","owner":"zaben903","description":"JournalRB is a pure Ruby library for logging to Journald through its Unix Socket.","archived":false,"fork":false,"pushed_at":"2026-04-12T09:21:56.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T17:47:30.813Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"https://rubydoc.info/github/zaben903/journalrb/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaben903.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","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-04-12T08:46:00.000Z","updated_at":"2026-04-13T00:31:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zaben903/journalrb","commit_stats":null,"previous_names":["zaben903/journalrb"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zaben903/journalrb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaben903%2Fjournalrb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaben903%2Fjournalrb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaben903%2Fjournalrb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaben903%2Fjournalrb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaben903","download_url":"https://codeload.github.com/zaben903/journalrb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaben903%2Fjournalrb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31808518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ruby"],"created_at":"2026-04-13T17:35:21.814Z","updated_at":"2026-04-14T18:00:35.376Z","avatar_url":"https://github.com/zaben903.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JournalRB\n\n[![Gem Version](https://badge.fury.io/rb/journalrb.svg)](https://badge.fury.io/rb/journalrb)\n[![CI Workflow](https://github.com/zaben903/journalrb/actions/workflows/main.yml/badge.svg)](https://github.com/zaben903/journalrb/actions/workflows/main.yml)\n[![CodeQL](https://github.com/zaben903/journalrb/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/zaben903/journalrb/actions/workflows/github-code-scanning/codeql)\n\nJournalRB is a pure Ruby library for logging to Journald through its Unix Socket.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n```bash\nbundle add journalrb\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```bash\ngem install journalrb\n```\n\n## Usage\n\nBasic usage:\n\n```ruby\nrequire \"journalrb\"\n\nlogger = JournalRB::Logger.new # Defaults to DEBUG level.\nlogger.debug(\"Messages which may need to be enabled first, only useful for debugging\")\nlogger.info(\"Normal operational messages that require no action\") # or logger.informational(\"Normal operational messages that require no action\")\nlogger.notice(\"Events that are unusual, but not error conditions\")\nlogger.warn(\"May indicate that an error will occur if action is not taken\") # or logger.warning(\"May indicate that an error will occur if action is not taken\")\nlogger.err(\"Error conditions\") # or logger.error(\"Error conditions\")\nlogger.crit(\"Critical conditions\") # or logger.critical(\"Critical conditions\")\nlogger.alert(\"Should be corrected immediately\")\nlogger.emerg(\"System is unusable\") # or logger.emergency(\"System is unusable\")\n\n# Blocks can also be used to provide the message as long as the value returned is a string.\nlogger.info { \"This is an informational message provided by a block\" }\n\n# Setting the log level\nlogger = JournalRB::Logger.new(level: :warning)\n# or\nlogger.level = :warning # or JournalRB::Logger::WARNING or 4\n# or\nlogger.warning!\n\n# You can check if the currently set log level allows with a given severity using\nlogger.debug?\nlogger.info? # or logger.informational?\nlogger.notice?\nlogger.warn? # or logger.warning?\nlogger.err? # or logger.error?\nlogger.crit? # or logger.critical?\nlogger.alert?\nlogger.emerg? # or logger.emergency?\n```\n\nJournalRB supports all standard Journald log priorities (emerg, alert, crit, err, warning, notice, info, debug).\nAdditional journal fields can be included in log entries by passing keyword arguments to the logging methods, and the message string can be provided either as a parameter or as a block.\n\nExample additional fields can be found at [systemd.journal-fields](https://www.freedesktop.org/software/systemd/man/latest/systemd.journal-fields.html) or as described in the `#add` method.\n\n```ruby\nrequire \"journalrb\"\n\nlogger = JournalRB::Logger.new\nlogger.error(\"An error occurred\", errno: 123, code_file: \"app.rb\", code_line: 42, code_func: \"perform_task\", documentation: \"https://example.com/docs/errors#123\", custom_field: \"custom_value\")\n```\n\nIf Journald is not configured to use the default socket path (`/run/systemd/journal/socket`), you can specify a custom socket path when initializing the logger:\n\n```ruby\nrequire \"journalrb\"\n\nlogger = JournalRB::Logger.new(socket: \"/custom/path/to/journal/socket\")\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/zaben903/journalrb.\n\n## License\n\nCopyright (C) 2026  Zach Bensley\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaben903%2Fjournalrb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaben903%2Fjournalrb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaben903%2Fjournalrb/lists"}