https://github.com/nerves-project/nerves_logging
Route system log messages through the Elixir logger
https://github.com/nerves-project/nerves_logging
logger nerves
Last synced: 5 months ago
JSON representation
Route system log messages through the Elixir logger
- Host: GitHub
- URL: https://github.com/nerves-project/nerves_logging
- Owner: nerves-project
- Created: 2022-04-09T01:59:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T03:14:57.000Z (6 months ago)
- Last Synced: 2025-04-10T03:19:31.306Z (6 months ago)
- Topics: logger, nerves
- Language: Elixir
- Homepage:
- Size: 95.7 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSES/Apache-2.0.txt
Awesome Lists containing this project
README
# NervesLogging
[](https://hex.pm/packages/nerves_logging)
[](https://hexdocs.pm/nerves_logging/NervesLogging.html)
[](https://circleci.com/gh/nerves-project/nerves_logging)
[](https://api.reuse.software/info/github.com/nerves-project/nerves_logging)NervesLogging forwards log messages from the Linux kernel and syslog to the
Elixir logger. It's used with Nerves so that all log messages pass through one
place.Messages logged by NervesLogging copy the "Syslog" severity directly to the
Logger level. This means that if the kernel's level is "Error", the Elixir level
will be `:error`. Since Elixir 1.11 and later have the same log levels as
Syslog, this mapping is 1:1.NervesLogging adds the following metadata to the log messages:
* `:facility` - the facility of the log message
* `:application` - either `:$kmsg` or `:$syslog`See the [Elixir Logger documentation](https://hexdocs.pm/logger/Logger.html) for
reducing what's logged if the system logs become too noisy. Some examples:```elixir
# Reduce logging for both syslog and kernel logs
Logger.put_application_level(:nerves_logging, :error)# Adjust logging for kernel logs
Logger.put_module_level(NervesLogging.KmsgTailer, :error)# Adjust logging for syslog logs
Logger.put_module_level(NervesLogging.SyslogTailer, :error)
```## Using
There's no configuration. If you're using Nerves, you should get this
application by default since it's a dependency of
[nerves_runtime](https://github.com/nerves-project/nerves_runtime).## License
All original source code in this project is licensed under Apache-2.0.
Additionally, this project follows the [REUSE recommendations](https://reuse.software)
and labels so that licensing and copyright are clear at the file level.Exceptions to Apache-2.0 licensing are:
* Configuration and data files are licensed under CC0-1.0
* Documentation is CC-BY-4.0