我正在使用 Elixir 的默认记录器模块来生成日志。但是没找到方法转储磁盘上的日志 .记录器模块中有这样的设施吗?或者是否有任何其他 Elixir/Erlang 库可以用于相同的用途?
最佳答案
Elixir 包含一个 Logger
图书馆。 Logger 支持写入日志消息的不同后端,但目前唯一的内置后端是 :console
.
在 Erlang 世界中,著名的日志库之一是 Lager
.事实上,这个库在去年的一篇 discussion in the elixir-lang-core 中也有提及。邮件列表。
在同一个线程中也提到了这个项目:onkel-dirtus/logger_file_backend .我还没有尝试过,但它似乎是你正在寻找的。
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.
关于logging - Elixir 中磁盘上的记录器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32993192/