{"id":13508248,"url":"https://github.com/tianyuanhao/kernel-syslog","last_synced_at":"2025-03-30T10:30:45.748Z","repository":{"id":216996138,"uuid":"340534628","full_name":"tianyuanhao/kernel-syslog","owner":"tianyuanhao","description":"📝 Kernel module that can be used as a replacement for syslog, logger or logwrapper","archived":false,"fork":false,"pushed_at":"2021-10-25T06:57:04.000Z","size":12,"stargazers_count":44,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-01T07:33:30.445Z","etag":null,"topics":["android","bash","dmesg","embedded","init","init-system","initramfs","journal","journalctl","kernel","kernel-module","kernel-modules","kmsg","linux","logger","logging","shell","syslog","systemd","ttyprintk"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tianyuanhao.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":"2021-02-20T01:42:26.000Z","updated_at":"2024-10-11T07:30:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"93931571-bf55-427d-be27-f78682551d6c","html_url":"https://github.com/tianyuanhao/kernel-syslog","commit_stats":null,"previous_names":["tianyuanhao/kernel-syslog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianyuanhao%2Fkernel-syslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianyuanhao%2Fkernel-syslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianyuanhao%2Fkernel-syslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianyuanhao%2Fkernel-syslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tianyuanhao","download_url":"https://codeload.github.com/tianyuanhao/kernel-syslog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246307580,"owners_count":20756473,"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","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":["android","bash","dmesg","embedded","init","init-system","initramfs","journal","journalctl","kernel","kernel-module","kernel-modules","kmsg","linux","logger","logging","shell","syslog","systemd","ttyprintk"],"created_at":"2024-08-01T02:00:50.341Z","updated_at":"2025-03-30T10:30:45.736Z","avatar_url":"https://github.com/tianyuanhao.png","language":"C","readme":"# Kernel logger\n\nKernel logger is a kernel module that can be used as a replacement for `logger` or `logwrapper`.\n\nIts log is similar to systemd's journal and can be read by `dmesg` or `journalctl`.\n\n## Use cases\n\n- You need to record the logs of initramfs and hope that journald can keep these logs.\n- You want a logger, but do not want or cannot make any changes to a program.\n- You find it annoying to type `logger` again and again in a shell script.\n\n[Here is a very suitable use case.](https://unix.stackexchange.com/questions/97580/init-syslog-and-stdout-stderr)\n\n## Why not kmsg or logger\n\n- kmsg could not add a tag\n- `logger` needs a backend\n\n## Quick start\n\n1. Compile and load this module\n\n```sh\nmake\nsudo insmod logger.ko\n```\n\n2. Run a shell command to test it\n\n```sh\nvagrant@ubuntu-focal:/vagrant$ echo \"This is just a test\" \u003e /dev/logger\nvagrant@ubuntu-focal:/vagrant$\nvagrant@ubuntu-focal:/vagrant$ dmesg | grep \"This is just a test\"\n[   55.750168] bash[1289]: This is just a test\nvagrant@ubuntu-focal:/vagrant$\nvagrant@ubuntu-focal:/vagrant$ journalctl -b | grep \"This is just a test\"\nMar 04 02:13:46 ubuntu-focal bash[1289]: This is just a test\n```\n\n## Usage in shell script\n\nJust add the following to the beginning of your shell script:\n\n```sh\nexec \u003e /dev/logger 2\u003e\u00261\n```\n\n## License\n\nThis project is licensed under [GPL-2.0](LICENSE).\n","funding_links":[],"categories":["C","bash"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftianyuanhao%2Fkernel-syslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftianyuanhao%2Fkernel-syslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftianyuanhao%2Fkernel-syslog/lists"}