View Source NervesLogging

CircleCI Hex version REUSE status

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.

The Syslog facility is passed via log metadata.

See the Elixir Logger documentation for reducing what's logged if the system logs become too noisy. For example, try Logger.put_application_level(:nerves_logging, :error).

Using

There's no configuration. Add the following to a supervision tree to capture the logs:

    [NervesLogging.KmsgTailer, NervesLogging.SyslogTailer]

If you're using Nerves, you don't need to do this. Nerves.Runtime adds these to its supervision tree.

License

All original source code in this project is licensed under Apache-2.0.

Additionally, this project follows the REUSE recommendations 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