简体   繁体   中英

Logger on the disk in Elixir

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM