{"id":50664981,"url":"https://github.com/nerves-project/ramoops_logger","last_synced_at":"2026-06-08T05:31:20.445Z","repository":{"id":35008786,"uuid":"168729934","full_name":"nerves-project/ramoops_logger","owner":"nerves-project","description":"Elixir Logger Backend that writes to the Linux Ramoops driver","archived":false,"fork":false,"pushed_at":"2026-05-30T19:53:46.000Z","size":82,"stargazers_count":11,"open_issues_count":1,"forks_count":3,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-05-30T21:19:57.352Z","etag":null,"topics":["elixir","elixir-logger","linux"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nerves-project.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"nerves-project"}},"created_at":"2019-02-01T16:51:04.000Z","updated_at":"2026-05-30T19:53:48.000Z","dependencies_parsed_at":"2024-09-28T17:20:33.397Z","dependency_job_id":null,"html_url":"https://github.com/nerves-project/ramoops_logger","commit_stats":{"total_commits":61,"total_committers":7,"mean_commits":8.714285714285714,"dds":0.5737704918032787,"last_synced_commit":"194a0078318c79105bcce95038b8e6146a08fb12"},"previous_names":["nerves-project/ramoops_logger","smartrent/ramoops_logger"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nerves-project/ramoops_logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerves-project%2Framoops_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerves-project%2Framoops_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerves-project%2Framoops_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerves-project%2Framoops_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nerves-project","download_url":"https://codeload.github.com/nerves-project/ramoops_logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerves-project%2Framoops_logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33833357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"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":["elixir","elixir-logger","linux"],"created_at":"2026-06-08T05:31:19.648Z","updated_at":"2026-06-08T05:31:20.440Z","avatar_url":"https://github.com/nerves-project.png","language":"Elixir","funding_links":["https://opencollective.com/nerves-project"],"categories":[],"sub_categories":[],"readme":"\u003c!--\n  SPDX-FileCopyrightText: 2020-21 SmartRent\n  SPDX-License-Identifier: CC-BY-4.0\n--\u003e\n\n# RamoopsLogger\n\n[![Hex version](https://img.shields.io/hexpm/v/ramoops_logger.svg \"Hex version\")](https://hex.pm/packages/ramoops_logger)\n[![API docs](https://img.shields.io/hexpm/v/ramoops_logger.svg?label=hexdocs \"API docs\")](https://ramoops-logger.hexdocs.pm/RamoopsLogger.html)\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/nerves-project/ramoops_logger/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/nerves-project/ramoops_logger/tree/main)\n[![REUSE status](https://api.reuse.software/badge/github.com/nerves-project/ramoops_logger)](https://api.reuse.software/info/github.com/nerves-project/ramoops_logger)\n\nThis library uses the Linux\n[pstore](https://www.kernel.org/doc/html/v6.12/admin-guide/pstore-blk.html) to\ncapture diagnostic information for unexpected reboots. The `pstore` is a special\nblock of DRAM managed by the kernel that can survive reboots. This works\nindependent of filesystems where logs are normally kept and since it's\nin-memory, there's no loss on unexpected reboots due to caching.\n\nThis library does require a properly configured kernel to work. In particular,\nit uses the user application accessible `pmsg` circular buffer.\n\nHere are some features:\n\n* Automatically record log messages of `:error` severity and higher\n* Retrieve logs from the previous reboot\n\nFor historical reasons, some `pstore` functionality was called `ramoops` and\nthat affects the naming of this library.\n\n## Configuration\n\nRamoopsLogger uses the Linux `pstore` device driver, so it only works on\nLinux-based platforms. Most official Nerves Projects systems start the `pstore`\ndriver automatically and you can skip the Linux configuration.\n\n### Linux configuration\n\nThe most important part of using the RamoopsLogger is ensuring that the `pstore`\ndevice driver is enabled and configured in your Linux kernel. Most of the\nofficial Nerves Project systems do this already.\n\nThe required kernel options are:\n\n```text\nCONFIG_PSTORE=y\nCONFIG_PSTORE_PMSG=y\nCONFIG_PSTORE_RAM=y\n```\n\nThen you'll need to allocate part of DRAM to use for `pstore` and configure\nmemory sizes. Please refer to Linux `pstore` documentation.\n\nIf you're using a system that uses device trees or device tree overlays, the\nfollowing snippet may help you find the parts that need configuration. Please,\nplease don't copy verbatim and expect it to work.\n\n```c\nreserved-memory {\n        #address-cells = \u003c1\u003e;\n        #size-cells = \u003c1\u003e;\n        ranges;\n\n        ramoops@88d00000{\n                compatible = \"ramoops\";\n                reg = \u003c0x88d00000 0x100000\u003e;\n                ecc-size = \u003c16\u003e; /* Optional */\n                record-size     = \u003c0x00020000\u003e; /* Optional */\n                console-size    = \u003c0x00020000\u003e; /* Optional */\n                ftrace-size     = \u003c0\u003e; /* Optional */\n                pmsg-size       = \u003c0x00020000\u003e; /* Important for RamoopsLogger */\n        };\n};\n```\n\nLook for `/dev/pmsg0` to verify that Linux loaded the `pstore` driver and it's\nproperly configured.\n\n### Update your Elixir project\n\nOnce you're satisfied with the Linux, add `ramoops_logger` to your project's\n`mix.exs` dependencies list.\n\n```elixir\ndef deps do\n  [\n    {:ramoops_logger, \"~\u003e 0.3.0\"}\n  ]\nend\n```\n\nNo application configuration is necessary as the defaults should all be fine. If\nyou do need to change something, here are the available options for your\n`config.exs` or `target.exs`:\n\n\n```elixir\nimport Config\n\nconfig :ramoops_logger,\n  pmsg_path: \"/dev/pmsg0\",              # If you have more than one pmsg buffer\n  pstore_mount_point: \"/sys/fs/pstore\", # Mount pstore in a custom location\n  pmsg_log: \"pmsg-ramoops-0\",           # Analogous to pmsg_path for more than one pmsg buffer\n  auto_mount?: true                     # Mount pstore automatically\n```\n\n## IEx Session Usage\n\nTo read the last ramoops log to the console run:\n\n```elixir\niex\u003e RamoopsLogger.dump()\n```\n\nTo read the last ramoops log and it to a variable run:\n\n```elixir\niex\u003e {:ok, contents} = RamoopsLogger.read()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerves-project%2Framoops_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerves-project%2Framoops_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerves-project%2Framoops_logger/lists"}