I am using Elixir's default Logger Module for generating logs. However, I didn't find a way to dump logs on the disk. Is there any such facility in Logger Module? Or is there any other Elixir/Erlang Library which can be used for the same?
A logger for Elixir applications. It includes many features: Provides debug, info, warn, and error levels. Supports multiple backends which are automatically supervised when plugged into Logger . Formats and truncates messages on the client to avoid clogging Logger backends.
The flash logger backend is used to store logs in non-volatile memory. The backend consists of two logical parts: flashlog and crashlog.
Logging Metadata Logger metadata is a keyword list stored in the process dictionary, so each process has an isolated metadata store. This means that setting metadata in one process won't affect the metadata in another process.
Elixir includes a Logger
library. Logger supports different backends where log messages are written to, however at the time being the only built-in backend is :console
.
In the Erlang world, one of the well known logging libraries is Lager
. In fact, this library was also mentioned last year in a discussion in the elixir-lang-core mailing list.
In the same thread there is also a mention to this project: onkel-dirtus/logger_file_backend. I haven't tried it yet, however it seems to be what you are looking for.
LoggerFileBackend
is a custom backend for the elixir :logger application. However, unlike the default :console backend, we may want to configure multiple log files, each with different log levels formats, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With