简体   繁体   English

Elixir磁盘上的记录器

[英]Logger on the disk in Elixir

I am using Elixir's default Logger Module for generating logs. 我使用Elixir的默认记录器模块来生成日志。 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 / Erlang图书馆可以使用它?

Elixir includes a Logger library. Elixir包括一个Logger库。 Logger supports different backends where log messages are written to, however at the time being the only built-in backend is :console . Logger支持写入日志消息的不同后端,但是当时唯一的内置后端是:console

In the Erlang world, one of the well known logging libraries is Lager . 在Erlang世界中,众所周知的日志记录库之一是Lager In fact, this library was also mentioned last year in a discussion in the elixir-lang-core mailing list. 事实上,去年在elixir-lang-core邮件列表的讨论中也提到了这个库。

In the same thread there is also a mention to this project: onkel-dirtus/logger_file_backend . 在同一个线程中还提到了这个项目: 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. LoggerFileBackend是elixir:logger应用程序的自定义后端。 However, unlike the default :console backend, we may want to configure multiple log files, each with different log levels formats, etc. 但是,与默认:控制台后端不同,我们可能希望配置多个日志文件,每个日志文件具有不同的日志级别格式等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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